RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Animation.java
1package com.osroyale.game;
2
3import java.util.Objects;
4
44
45public class Animation implements Comparable<Animation> {
46
47 public static final int RESET_ID = 65535;
48 public static final int NORMAL_TELE_ID = 714;
49 public static final int LUNAR_TELE_ID = 1816;
50
51 public static final Animation RESET = new Animation(RESET_ID, UpdatePriority.VERY_LOW);
52 public static final Animation NORMAL_TELE = new Animation(NORMAL_TELE_ID, UpdatePriority.VERY_HIGH);
53 public static final Animation LUNAR_TELE = new Animation(LUNAR_TELE_ID, UpdatePriority.VERY_HIGH);
54
55
57 private final int id;
58
60 private final int delay;
61
63 private final UpdatePriority priority;
64
71 public Animation(int id) {
72 this(id, 0, UpdatePriority.NORMAL);
73 }
74
83 public Animation(int id, int delay) {
84 this(id, delay, UpdatePriority.NORMAL);
85 }
86
95 public Animation(int id, UpdatePriority priority) {
96 this(id, 0, priority);
97 }
98
109 public Animation(int id, int delay, UpdatePriority priority) {
110 this.priority = priority;
111 this.id = id;
112 this.delay = delay;
113 }
114
120 public int getDelay() {
121 return delay;
122 }
123
129 public int getId() {
130 return id;
131 }
132
133 @Override
134 public int hashCode() {
135 return Objects.hash(id, delay, priority);
136 }
137
138 @Override
139 public boolean equals(Object obj) {
140 if (obj instanceof Animation) {
141 Animation other = (Animation) obj;
142 return id == other.id && delay == other.delay && priority == other.priority;
143 }
144 return obj == this;
145 }
146
147 @Override
148 public int compareTo(Animation other) {
149 if (other == null || other.priority == null) {
150 return 1;
151 }
152
153 return other.priority.compareTo(priority);
154 }
155
156 @Override
157 public String toString() {
158 return String.format("Animation[priority=%s, id=%s, delay=%s]", priority, id, delay);
159 }
160
161 public boolean isReset() {
162 return id == -1 || id == RESET_ID;
163 }
164
165}
Animation(int id, UpdatePriority priority)
Animation(int id, int delay, UpdatePriority priority)
Animation(int id, int delay)