RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.Animation Class Reference

Class that models a single animation used by an entity. More...

Inheritance diagram for com.runehive.game.Animation:
Collaboration diagram for com.runehive.game.Animation:

Public Member Functions

 Animation (int id)
 Creates a new instance of the animation with a hidden delay of 0.
 Animation (int id, int delay)
 Creates a new instance of the animation with a specified delay.
 Animation (int id, int delay, UpdatePriority priority)
 Creates a new instance of the animation with a specified delay.
 Animation (int id, UpdatePriority priority)
 Creates a new instance of the animation with a hidden delay of 0.
int compareTo (Animation other)
boolean equals (Object obj)
int getDelay ()
 Gets the animation delay.
int getId ()
 Gets the animation id.
int hashCode ()
boolean isReset ()
String toString ()

Static Public Attributes

static final Animation LUNAR_TELE = new Animation(LUNAR_TELE_ID, UpdatePriority.VERY_HIGH)
static final int LUNAR_TELE_ID = 1816
static final Animation NORMAL_TELE = new Animation(NORMAL_TELE_ID, UpdatePriority.VERY_HIGH)
static final int NORMAL_TELE_ID = 714
static final Animation RESET = new Animation(RESET_ID, UpdatePriority.VERY_LOW)
static final int RESET_ID = 65535

Private Attributes

final int delay
 The delay before playing the animation.
final int id
 The animation id.
final UpdatePriority priority
 The animation priority.

Detailed Description

Class that models a single animation used by an entity.

Author
Michael | Chex

Definition at line 10 of file Animation.java.

Constructor & Destructor Documentation

◆ Animation() [1/4]

com.runehive.game.Animation.Animation ( int id)

Creates a new instance of the animation with a hidden delay of 0.

Parameters
idThe id of the animation being used.

Definition at line 36 of file Animation.java.

36 {
37 this(id, 0, UpdatePriority.NORMAL);
38 }

References id, and com.runehive.game.UpdatePriority.NORMAL.

Referenced by compareTo(), and equals().

Here is the caller graph for this function:

◆ Animation() [2/4]

com.runehive.game.Animation.Animation ( int id,
int delay )

Creates a new instance of the animation with a specified delay.

Parameters
idThe id of the animation being used.
delayThe delay of the animation in seconds.

Definition at line 48 of file Animation.java.

48 {
49 this(id, delay, UpdatePriority.NORMAL);
50 }

References delay, id, and com.runehive.game.UpdatePriority.NORMAL.

◆ Animation() [3/4]

com.runehive.game.Animation.Animation ( int id,
UpdatePriority priority )

Creates a new instance of the animation with a hidden delay of 0.

Parameters
idThe id of the animation being used.
priorityThe priority level of the animation.

Definition at line 60 of file Animation.java.

60 {
61 this(id, 0, priority);
62 }

References id, and priority.

◆ Animation() [4/4]

com.runehive.game.Animation.Animation ( int id,
int delay,
UpdatePriority priority )

Creates a new instance of the animation with a specified delay.

Parameters
idThe id of the animation being used.
delayThe delay of the animation in seconds.
priorityThe priority level of the animation.

Definition at line 74 of file Animation.java.

74 {
75 this.priority = priority;
76 this.id = id;
77 this.delay = delay;
78 }

References delay, id, and priority.

Member Function Documentation

◆ compareTo()

int com.runehive.game.Animation.compareTo ( Animation other)

Definition at line 113 of file Animation.java.

113 {
114 if (other == null || other.priority == null) {
115 return 1;
116 }
117
118 return other.priority.compareTo(priority);
119 }

References Animation(), and priority.

Here is the call graph for this function:

◆ equals()

boolean com.runehive.game.Animation.equals ( Object obj)

Definition at line 104 of file Animation.java.

104 {
105 if (obj instanceof Animation) {
106 Animation other = (Animation) obj;
107 return id == other.id && delay == other.delay && priority == other.priority;
108 }
109 return obj == this;
110 }

References Animation(), delay, and priority.

Here is the call graph for this function:

◆ getDelay()

int com.runehive.game.Animation.getDelay ( )

Gets the animation delay.

Returns
The delay.

Definition at line 85 of file Animation.java.

85 {
86 return delay;
87 }

References delay.

Referenced by com.runehive.net.packet.out.SendNpcUpdate.appendAnimationMask(), and com.runehive.net.packet.out.SendPlayerUpdate.appendAnimationMask().

Here is the caller graph for this function:

◆ getId()

int com.runehive.game.Animation.getId ( )

Gets the animation id.

Returns
The id.

Definition at line 94 of file Animation.java.

94 {
95 return id;
96 }

References id.

Referenced by com.runehive.net.packet.out.SendNpcUpdate.appendAnimationMask(), and com.runehive.net.packet.out.SendPlayerUpdate.appendAnimationMask().

Here is the caller graph for this function:

◆ hashCode()

int com.runehive.game.Animation.hashCode ( )

Definition at line 99 of file Animation.java.

99 {
100 return Objects.hash(id, delay, priority);
101 }

References delay, and priority.

◆ isReset()

boolean com.runehive.game.Animation.isReset ( )

Definition at line 126 of file Animation.java.

126 {
127 return id == -1 || id == RESET_ID;
128 }

References RESET_ID.

Referenced by com.runehive.game.world.entity.combat.strategy.npc.NpcMagicStrategy.sendAnimation(), and com.runehive.game.world.entity.combat.strategy.npc.NpcRangedStrategy.sendAnimation().

Here is the caller graph for this function:

◆ toString()

String com.runehive.game.Animation.toString ( )

Definition at line 122 of file Animation.java.

122 {
123 return String.format("Animation[priority=%s, id=%s, delay=%s]", priority, id, delay);
124 }

References delay, and priority.

Member Data Documentation

◆ delay

final int com.runehive.game.Animation.delay
private

The delay before playing the animation.

Definition at line 25 of file Animation.java.

Referenced by Animation(), Animation(), equals(), getDelay(), hashCode(), and toString().

◆ id

final int com.runehive.game.Animation.id
private

The animation id.

Definition at line 22 of file Animation.java.

Referenced by Animation(), Animation(), Animation(), Animation(), and getId().

◆ LUNAR_TELE

final Animation com.runehive.game.Animation.LUNAR_TELE = new Animation(LUNAR_TELE_ID, UpdatePriority.VERY_HIGH)
static

Definition at line 18 of file Animation.java.

◆ LUNAR_TELE_ID

final int com.runehive.game.Animation.LUNAR_TELE_ID = 1816
static

Definition at line 14 of file Animation.java.

◆ NORMAL_TELE

final Animation com.runehive.game.Animation.NORMAL_TELE = new Animation(NORMAL_TELE_ID, UpdatePriority.VERY_HIGH)
static

Definition at line 17 of file Animation.java.

◆ NORMAL_TELE_ID

final int com.runehive.game.Animation.NORMAL_TELE_ID = 714
static

Definition at line 13 of file Animation.java.

◆ priority

final UpdatePriority com.runehive.game.Animation.priority
private

The animation priority.

Definition at line 28 of file Animation.java.

Referenced by Animation(), Animation(), compareTo(), equals(), hashCode(), and toString().

◆ RESET

final Animation com.runehive.game.Animation.RESET = new Animation(RESET_ID, UpdatePriority.VERY_LOW)
static

◆ RESET_ID

final int com.runehive.game.Animation.RESET_ID = 65535
static

Definition at line 12 of file Animation.java.

Referenced by isReset().


The documentation for this class was generated from the following file: