RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.action.impl.EmoteAction Class Reference

Handles performing an emote action. More...

Inheritance diagram for com.runehive.game.action.impl.EmoteAction:
Collaboration diagram for com.runehive.game.action.impl.EmoteAction:

Public Member Functions

 EmoteAction (Player player, int animation, int graphic)
 Constructs a new EmoteAction.
void execute ()
 A function representing the unit of work that will be carried out.
String getName ()
 Gets the name of this action.
WalkablePolicy getWalkablePolicy ()
 Gets the WalkablePolicy of this action.
boolean prioritized ()
 Determines if this action is prioritized.
Public Member Functions inherited from com.runehive.game.action.Action< T extends Mob >
 Action (T mob, int delay)
 Creates a new Action randomevent.
 Action (T mob, int delay, boolean instant)
 Creates a new Action randomevent.
boolean cancellableInProgress ()
getMob ()
 Gets the player.
Public Member Functions inherited from com.runehive.game.task.Task
Task attach (Object newKey)
 Attaches a new key.
synchronized final void cancel ()
 Cancels all subsequent executions.
synchronized final void cancel (boolean logout)
 Cancels all subsequent executions.
boolean canRun ()
 Determines if the task can be ran.
Optional< Object > getAttachment ()
String getCreationStackTraceStr ()
int getDelay ()
Long getElapsedTimeFromRunStartTime ()
Optional< Long > getRunStartTime ()
long getTaskCreationTime ()
String getTaskId ()
boolean isInstant ()
boolean isRunning ()
void setDelay (int delay)
 Sets the cyclic delay.
void setExecutionTime ()
 Task (boolean instant, int delay)
 Creates a new Task.
 Task (int delay)
 Creates a new Task that doesn't execute instantly.

Private Attributes

final int animation
 The animation identification.
final int graphic
 The graphic identification.

Additional Inherited Members

Protected Member Functions inherited from com.runehive.game.task.Task
void baseExecute ()
boolean canSchedule ()
 A function executed on registration.
void onCancel (boolean logout)
 A function executed on cancellation.
void onSchedule ()
 A function executed on registration.
Package Functions inherited from com.runehive.game.task.Task
void onException (Exception e)
 A function executed on thrown exceptions.
void onLoop ()
 A function executed when iterated over.
final synchronized void process ()
synchronized void setRunning (boolean running)

Detailed Description

Handles performing an emote action.

Author
Daniel

Definition at line 14 of file EmoteAction.java.

Constructor & Destructor Documentation

◆ EmoteAction()

com.runehive.game.action.impl.EmoteAction.EmoteAction ( Player player,
int animation,
int graphic )

Constructs a new EmoteAction.

Parameters
playerThe player instance.
animationThe animation identification.
graphicThe graphic identification.

Definition at line 32 of file EmoteAction.java.

32 {
33 super(player, 3, true);
34 this.animation = animation;
35 this.graphic = graphic;
36 }

References animation, and graphic.

Member Function Documentation

◆ execute()

void com.runehive.game.action.impl.EmoteAction.execute ( )

A function representing the unit of work that will be carried out.

Reimplemented from com.runehive.game.task.Task.

Definition at line 39 of file EmoteAction.java.

39 {
40 if (animation != -1) {
41 getMob().animate(new Animation(animation));
42 }
43
44 if (graphic != -1) {
45 getMob().graphic(new Graphic(graphic));
46 }
47
48 cancel();
49 }

References animation, com.runehive.game.task.Task.cancel(), com.runehive.game.action.Action< T extends Mob >.getMob(), and graphic.

Here is the call graph for this function:

◆ getName()

String com.runehive.game.action.impl.EmoteAction.getName ( )

Gets the name of this action.

Returns
The name of this action.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 52 of file EmoteAction.java.

52 {
53 return "Emote";
54 }

◆ getWalkablePolicy()

WalkablePolicy com.runehive.game.action.impl.EmoteAction.getWalkablePolicy ( )

Gets the WalkablePolicy of this action.

Returns
The walkable policy of this action.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 62 of file EmoteAction.java.

62 {
63 return WalkablePolicy.NON_WALKABLE;
64 }

References com.runehive.game.action.policy.WalkablePolicy.NON_WALKABLE.

◆ prioritized()

boolean com.runehive.game.action.impl.EmoteAction.prioritized ( )

Determines if this action is prioritized.

When making an action prioritized, the next action will be ignored if not queued.

Returns
true if this action is prioritized, false otherwise.

Reimplemented from com.runehive.game.action.Action< T extends Mob >.

Definition at line 57 of file EmoteAction.java.

57 {
58 return false;
59 }

Member Data Documentation

◆ animation

final int com.runehive.game.action.impl.EmoteAction.animation
private

The animation identification.

Definition at line 18 of file EmoteAction.java.

Referenced by EmoteAction(), and execute().

◆ graphic

final int com.runehive.game.action.impl.EmoteAction.graphic
private

The graphic identification.

Definition at line 23 of file EmoteAction.java.

Referenced by EmoteAction(), and execute().


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