1 package de.lathanda.eos.game;
3 import java.util.Objects;
5 import de.lathanda.eos.base.MutableColor;
6 import de.lathanda.eos.base.Picture;
7 import de.lathanda.eos.game.geom.Shape;
46 public abstract class Sprite implements Comparable<Sprite> {
51 private static int nextID = 1;
55 private final Integer
id = nextID++;
78 private long start = -1;
82 private long sleepUntil = -1;
119 if (getClass() != obj.getClass()) {
123 if (!Objects.equals(
this.id, other.id)) {
136 return Integer.MIN_VALUE;
138 int v = w.plane - plane;
139 return (v == 0) ? w.id - id : v;
191 this.round =
round - start;
192 if (this.round > sleepUntil) {
223 public final void sleep(
int rounds) {
224 sleepUntil =
round + rounds;
231 sleepUntil = Long.MAX_VALUE;
static final MutableColor GREEN
static final MutableColor GRAY
void drawShape(Shape shape)
void setFillColor(MutableColor c)
void setLineColor(MutableColor c)
final void sleep(int rounds)
boolean processCollision(Sprite b, Game game)
final int compareTo(Sprite w)
Shape shape
Bounding Box des Sprites.
boolean equals(Object obj)
final void update(long round, Game game)
long round
Anzahl der vergangenen Runden seit Objekterzeugung.