RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Graphic.java
1package com.osroyale.game;
2
3import java.util.Objects;
4
44
45public final class Graphic implements Comparable<Graphic> {
46
47 public static final int HIGH_HEIGHT = 0x640000;
48
49 public static final int NORMAL_ID = 308;
50 public static final int LUNAR_ID = 747;
51 public static final int RESET_ID = 0xFFFF;
52 public static final Graphic RESET = new Graphic(RESET_ID, UpdatePriority.VERY_LOW);
53 public static final Graphic NORMAL_TELE = new Graphic(NORMAL_ID, 43, UpdatePriority.VERY_HIGH);
54 public static final Graphic LUNAR_TELE = new Graphic(LUNAR_ID, 0, UpdatePriority.VERY_HIGH);
55
57 private final int id;
58
60 private final int delay;
61
63 private final int height;
64
66 private final UpdatePriority priority;
67
75 public Graphic(int id) {
76 this(id, 0, false);
77 }
78
89 public Graphic(int id, boolean high) {
90 this(id, 0, high);
91 }
92
103 public Graphic(int id, int delay) {
104 this(id, delay, false);
105 }
106
119 public Graphic(int id, int delay, boolean high) {
120 this(id, delay, high, UpdatePriority.NORMAL);
121 }
122
131 public Graphic(int id, UpdatePriority priority) {
132 this(id, 0, false, priority);
133 }
134
146 public Graphic(int id, boolean high, UpdatePriority priority) {
147 this(id, 0, high, priority);
148 }
149
161 public Graphic(int id, int delay, UpdatePriority priority) {
162 this(id, delay, false, priority);
163 }
164
179 public Graphic(int id, int delay, boolean high, UpdatePriority priority) {
180 this(id, delay, high ? HIGH_HEIGHT : 0, priority);
181 }
182
183 public Graphic(int id, int delay, int height, UpdatePriority priority) {
184 this.id = id;
185 this.delay = delay;
186 this.height = height;
187 this.priority = priority;
188 }
189
190 public Graphic(int id, int delay, int height) {
191 this.id = id;
192 this.delay = delay;
193 this.height = height;
194 this.priority = UpdatePriority.NORMAL;
195 }
196
202 public int getDelay() {
203 return delay;
204 }
205
211 public int getHeight() {
212 return height;
213 }
214
220 public int getId() {
221 return id;
222 }
223
224 @Override
225 public int hashCode() {
226 return Objects.hash(id, delay, height, priority);
227 }
228
229 @Override
230 public boolean equals(Object obj) {
231 if (obj instanceof Graphic) {
232 Graphic other = (Graphic) obj;
233 return id == other.id && height == other.height && delay == other.delay && priority == other.priority;
234 }
235 return obj == this;
236 }
237
238 @Override
239 public int compareTo(Graphic other) {
240 return other.priority.ordinal() - priority.ordinal();
241 }
242
243 @Override
244 public String toString() {
245 return String.format("Graphic[id=%s, delay=%s, height=%s, priority=%s]", id, delay, height, priority);
246 }
247
248}
Graphic(int id, UpdatePriority priority)
Definition Graphic.java:131
Graphic(int id, int delay, boolean high)
Definition Graphic.java:119
Graphic(int id, boolean high)
Definition Graphic.java:89
Graphic(int id, boolean high, UpdatePriority priority)
Definition Graphic.java:146
Graphic(int id, int delay)
Definition Graphic.java:103
Graphic(int id, int delay, UpdatePriority priority)
Definition Graphic.java:161
Graphic(int id, int delay, boolean high, UpdatePriority priority)
Definition Graphic.java:179