RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Animation.java
1
package
com.osroyale.game;
2
3
import
java.util.Objects;
4
44
45
public
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
}
com.osroyale.game.Animation.Animation
Animation(int id, UpdatePriority priority)
Definition
Animation.java:95
com.osroyale.game.Animation.Animation
Animation(int id, int delay, UpdatePriority priority)
Definition
Animation.java:109
com.osroyale.game.Animation.Animation
Animation(int id, int delay)
Definition
Animation.java:83
com.osroyale.game.Animation.Animation
Animation(int id)
Definition
Animation.java:71
com.osroyale.game.Animation.getDelay
int getDelay()
Definition
Animation.java:120
com.osroyale.game.Animation.getId
int getId()
Definition
Animation.java:129
com.osroyale.game.UpdatePriority
Definition
UpdatePriority.java:35
com.osroyale.game.UpdatePriority.VERY_HIGH
VERY_HIGH
Definition
UpdatePriority.java:50
com.osroyale.game.UpdatePriority.VERY_LOW
VERY_LOW
Definition
UpdatePriority.java:38
com.osroyale.game.UpdatePriority.NORMAL
NORMAL
Definition
UpdatePriority.java:44