RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.action.impl.InspectAction Class Referenceabstract
Inheritance diagram for com.runehive.game.action.impl.InspectAction:
Collaboration diagram for com.runehive.game.action.impl.InspectAction:

Public Member Functions

void execute ()
 A function representing the unit of work that will be carried out.
abstract int getInspectDelay ()
 Inspection time consumption.
WalkablePolicy getWalkablePolicy ()
 Gets the WalkablePolicy of this action.
abstract void giveRewards (Player player)
 Rewards to give the player.
abstract void init ()
 Initialization method.
 InspectAction (Player player, Position position)
 Constructor.
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.
abstract String getName ()
 Gets the name of this action.
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

Position position
 The position.

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

Definition at line 8 of file InspectAction.java.

Constructor & Destructor Documentation

◆ InspectAction()

com.runehive.game.action.impl.InspectAction.InspectAction ( Player player,
Position position )

Constructor.

Parameters
player
position

Definition at line 21 of file InspectAction.java.

21 {
22 super(player, 1, true);
23 this.position = position;
24 }

References position.

Member Function Documentation

◆ execute()

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

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

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

Definition at line 37 of file InspectAction.java.

37 {
38 if (getDelay() == 0) {
39 setDelay(getInspectDelay());
40 init();
41 if (this.isRunning()) {
42 getMob().face(position);
43 }
44 } else {
45 giveRewards(getMob());
46 cancel();
47 }
48 }

References com.runehive.game.task.Task.cancel(), com.runehive.game.task.Task.getDelay(), getInspectDelay(), com.runehive.game.action.Action< T extends Mob >.getMob(), giveRewards(), init(), com.runehive.game.task.Task.isRunning(), and com.runehive.game.task.Task.setDelay().

Here is the call graph for this function:

◆ getInspectDelay()

abstract int com.runehive.game.action.impl.InspectAction.getInspectDelay ( )
abstract

Inspection time consumption.

Returns

Referenced by execute().

Here is the caller graph for this function:

◆ getWalkablePolicy()

WalkablePolicy com.runehive.game.action.impl.InspectAction.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 32 of file InspectAction.java.

32 {
33 return WalkablePolicy.NON_WALKABLE;
34 }

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

◆ giveRewards()

abstract void com.runehive.game.action.impl.InspectAction.giveRewards ( Player player)
abstract

Rewards to give the player.

Parameters
player

Referenced by execute().

Here is the caller graph for this function:

◆ init()

abstract void com.runehive.game.action.impl.InspectAction.init ( )
abstract

Initialization method.

Referenced by execute().

Here is the caller graph for this function:

◆ prioritized()

boolean com.runehive.game.action.impl.InspectAction.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 27 of file InspectAction.java.

27 {
28 return false;
29 }

Member Data Documentation

◆ position

Position com.runehive.game.action.impl.InspectAction.position
private

The position.

Definition at line 13 of file InspectAction.java.

Referenced by InspectAction().


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