1package com.osroyale.game;
3import java.util.Objects;
45public final class Graphic implements Comparable<Graphic> {
47 public static final int HIGH_HEIGHT = 0x640000;
49 public static final int NORMAL_ID = 308;
50 public static final int LUNAR_ID = 747;
51 public static final int RESET_ID = 0xFFFF;
60 private final int delay;
63 private final int height;
104 this(id, delay,
false);
119 public Graphic(
int id,
int delay,
boolean high) {
132 this(id, 0,
false, priority);
147 this(id, 0, high, priority);
162 this(id, delay,
false, priority);
180 this(id, delay, high ? HIGH_HEIGHT : 0, priority);
186 this.height = height;
187 this.priority = priority;
190 public Graphic(
int id,
int delay,
int height) {
193 this.height = height;
194 this.priority = UpdatePriority.
NORMAL;
225 public int hashCode() {
226 return Objects.hash(
id, delay, height, priority);
230 public boolean equals(Object obj) {
233 return id == other.id && height == other.height && delay == other.delay && priority == other.priority;
239 public int compareTo(
Graphic other) {
240 return other.priority.ordinal() - priority.ordinal();
244 public String toString() {
245 return String.format(
"Graphic[id=%s, delay=%s, height=%s, priority=%s]",
id, delay, height, priority);
Graphic(int id, UpdatePriority priority)
Graphic(int id, int delay, boolean high)
Graphic(int id, boolean high)
Graphic(int id, boolean high, UpdatePriority priority)
Graphic(int id, int delay)
Graphic(int id, int delay, UpdatePriority priority)
Graphic(int id, int delay, boolean high, UpdatePriority priority)