2015-03-20 00:03:07 +01:00
|
|
|
/*
|
|
|
|
* opsu! - an open-source osu! client
|
|
|
|
* Copyright (C) 2014, 2015 Jeffrey Han
|
|
|
|
*
|
|
|
|
* opsu! is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* opsu! is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with opsu!. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package itdelatrisu.opsu.objects;
|
|
|
|
|
2015-05-17 03:42:03 +02:00
|
|
|
import itdelatrisu.opsu.beatmap.HitObject;
|
2015-09-05 19:53:42 +02:00
|
|
|
import itdelatrisu.opsu.objects.curves.Vec2f;
|
2015-03-20 00:03:07 +01:00
|
|
|
|
2016-09-30 19:38:02 +02:00
|
|
|
import org.newdawn.slick.Color;
|
2015-03-20 00:03:07 +01:00
|
|
|
import org.newdawn.slick.Graphics;
|
|
|
|
|
|
|
|
/**
|
2015-05-17 03:42:03 +02:00
|
|
|
* Dummy hit object, used when another GameObject class cannot be created.
|
2015-03-20 00:03:07 +01:00
|
|
|
*/
|
2016-09-27 19:56:02 +02:00
|
|
|
public class DummyObject extends GameObject {
|
2015-05-17 03:42:03 +02:00
|
|
|
/** The associated HitObject. */
|
|
|
|
private HitObject hitObject;
|
2015-03-20 00:03:07 +01:00
|
|
|
|
|
|
|
/** The scaled starting x, y coordinates. */
|
|
|
|
private float x, y;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor.
|
2015-05-17 03:42:03 +02:00
|
|
|
* @param hitObject the associated HitObject
|
2015-03-20 00:03:07 +01:00
|
|
|
*/
|
2015-05-17 03:42:03 +02:00
|
|
|
public DummyObject(HitObject hitObject) {
|
2015-03-20 00:03:07 +01:00
|
|
|
this.hitObject = hitObject;
|
2015-03-31 05:06:52 +02:00
|
|
|
updatePosition();
|
2015-03-20 00:03:07 +01:00
|
|
|
}
|
|
|
|
|
2016-10-01 11:34:32 +02:00
|
|
|
public DummyObject() {
|
|
|
|
this.hitObject = new HitObject("0,0,0,1,0,0:0:0:0:");
|
|
|
|
updatePosition();
|
|
|
|
updateStartEndPositions(0);
|
|
|
|
}
|
|
|
|
|
2015-03-20 00:03:07 +01:00
|
|
|
@Override
|
2016-09-29 21:40:42 +02:00
|
|
|
public void draw(Graphics g, int trackPosition, boolean mirror) {}
|
2015-03-20 00:03:07 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean update(boolean overlap, int delta, int mouseX, int mouseY, boolean keyPressed, int trackPosition) {
|
|
|
|
return (trackPosition > hitObject.getTime());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean mousePressed(int x, int y, int trackPosition) { return false; }
|
|
|
|
|
|
|
|
@Override
|
2015-09-05 19:53:42 +02:00
|
|
|
public Vec2f getPointAt(int trackPosition) { return new Vec2f(x, y); }
|
2015-03-20 00:03:07 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getEndTime() { return hitObject.getTime(); }
|
2015-03-31 05:06:52 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void updatePosition() {
|
|
|
|
this.x = hitObject.getScaledX();
|
|
|
|
this.y = hitObject.getScaledY();
|
|
|
|
}
|
2015-04-05 17:24:05 +02:00
|
|
|
|
|
|
|
@Override
|
2015-06-30 02:22:38 +02:00
|
|
|
public void reset() {}
|
2016-09-27 19:56:02 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isCircle() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isSlider() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isSpinner() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-09-30 19:38:02 +02:00
|
|
|
@Override
|
|
|
|
public Color getColor() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Color getMirroredColor() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2015-03-20 00:03:07 +01:00
|
|
|
}
|