Very minor follow-up to #61.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-03-30 23:06:52 -04:00
parent f63be81490
commit 4b91018b70
7 changed files with 117 additions and 118 deletions

View File

@@ -74,12 +74,11 @@ public class Circle implements HitObject {
*/
public Circle(OsuHitObject hitObject, Game game, GameData data, Color color, boolean comboEnd) {
this.hitObject = hitObject;
this.x = hitObject.getScaledX();
this.y = hitObject.getScaledY();
this.game = game;
this.data = data;
this.color = color;
this.comboEnd = comboEnd;
updatePosition();
}
@Override

View File

@@ -38,8 +38,7 @@ public class DummyObject implements HitObject {
*/
public DummyObject(OsuHitObject hitObject) {
this.hitObject = hitObject;
this.x = hitObject.getScaledX();
this.y = hitObject.getScaledY();
updatePosition();
}
@Override
@@ -53,15 +52,15 @@ public class DummyObject implements HitObject {
@Override
public boolean mousePressed(int x, int y, int trackPosition) { return false; }
@Override
public void updatePosition() {
this.x = hitObject.getScaledX();
this.y = hitObject.getScaledY();
}
@Override
public float[] getPointAt(int trackPosition) { return new float[] { x, y }; }
@Override
public int getEndTime() { return hitObject.getTime(); }
@Override
public void updatePosition() {
this.x = hitObject.getScaledX();
this.y = hitObject.getScaledY();
}
}

View File

@@ -18,7 +18,6 @@
package itdelatrisu.opsu.objects;
import itdelatrisu.opsu.OsuHitObject;
import org.newdawn.slick.Graphics;
/**
@@ -67,7 +66,7 @@ public interface HitObject {
public int getEndTime();
/**
* Updates position of hit object.
* Updates the position of the hit object.
*/
public void updatePosition();
}

View File

@@ -135,17 +135,11 @@ public class Slider implements HitObject {
*/
public Slider(OsuHitObject hitObject, Game game, GameData data, Color color, boolean comboEnd) {
this.hitObject = hitObject;
this.x = hitObject.getScaledX();
this.y = hitObject.getScaledY();
this.game = game;
this.data = data;
this.color = color;
this.comboEnd = comboEnd;
if (hitObject.getSliderType() == OsuHitObject.SLIDER_PASSTHROUGH && hitObject.getSliderX().length == 2)
this.curve = new CircumscribedCircle(hitObject, color);
else
this.curve = new LinearBezier(hitObject, color);
updatePosition();
// slider time calculations
this.sliderTime = game.getBeatLength() * (hitObject.getPixelLength() / sliderMultiplier) / 100f;