Crossfire JXClient, Trunk
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.map.PendingDirections Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.map.PendingDirections:
Collaboration graph

Classes

class  Rec
 
enum  State
 

Public Member Functions

void add (final int direction, final int packetNo)
 
void clear ()
 
void comc (final int packetNo)
 
Iterable< @NotNull Integer > getPendingDirections ()
 
int getRunDirection ()
 
void mapScroll (final int direction)
 
 PendingDirections ()
 
void run (final int direction)
 
void tick ()
 
String toString ()
 

Private Member Functions

void reset ()
 

Private Attributes

final List< @NotNull RecpendingDirections = new ArrayList<>()
 
int runDirection = -1
 
State state = State.IDLE
 

Detailed Description

Maintains pending movements of the character. Whenever a movement command is sent to the server, it is stored. When the server has executed the command, it is removed.

In case the server does not execute the movement command (for example because the character was stopped by an obstacle), the pending movements are cleared.

Author
Andreas Kirschbaum

Definition at line 40 of file PendingDirections.java.

Constructor & Destructor Documentation

◆ PendingDirections()

com.realtime.crossfire.jxclient.map.PendingDirections.PendingDirections ( )

Creates a new instance.

Definition at line 63 of file PendingDirections.java.

References com.realtime.crossfire.jxclient.map.PendingDirections.reset().

Here is the call graph for this function:

Member Function Documentation

◆ add()

void com.realtime.crossfire.jxclient.map.PendingDirections.add ( final int  direction,
final int  packetNo 
)

Adds a pending step.

Parameters
directionthe direction of the step
packetNothe packet number for tracking responses

Definition at line 103 of file PendingDirections.java.

References com.realtime.crossfire.jxclient.map.PendingDirections.pendingDirections.

Referenced by com.realtime.crossfire.jxclient.queue.CommandQueue.sendNcom().

Here is the caller graph for this function:

◆ clear()

void com.realtime.crossfire.jxclient.map.PendingDirections.clear ( )

◆ comc()

void com.realtime.crossfire.jxclient.map.PendingDirections.comc ( final int  packetNo)

◆ getPendingDirections()

Iterable<@NotNull Integer> com.realtime.crossfire.jxclient.map.PendingDirections.getPendingDirections ( )

Returns the currently pending directions.

Returns
the pending directions

Definition at line 72 of file PendingDirections.java.

References com.realtime.crossfire.jxclient.map.PendingDirections.Rec.getDirection(), and com.realtime.crossfire.jxclient.map.PendingDirections.pendingDirections.

Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMapDirections.paintComponent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRunDirection()

int com.realtime.crossfire.jxclient.map.PendingDirections.getRunDirection ( )

Returns the direction the character is running.

Returns
the direction or -1 when not running

Definition at line 82 of file PendingDirections.java.

References com.realtime.crossfire.jxclient.map.PendingDirections.pendingDirections, and com.realtime.crossfire.jxclient.map.PendingDirections.runDirection.

Referenced by com.realtime.crossfire.jxclient.gui.map.GUIMapDirections.paintComponent().

Here is the caller graph for this function:

◆ mapScroll()

void com.realtime.crossfire.jxclient.map.PendingDirections.mapScroll ( final int  direction)

◆ reset()

void com.realtime.crossfire.jxclient.map.PendingDirections.reset ( )
private

◆ run()

void com.realtime.crossfire.jxclient.map.PendingDirections.run ( final int  direction)

Sets the directions the character is currently running to.

Parameters
directionthe direction or -1 when not running

Definition at line 113 of file PendingDirections.java.

References com.realtime.crossfire.jxclient.map.PendingDirections.pendingDirections, and com.realtime.crossfire.jxclient.map.PendingDirections.runDirection.

Referenced by com.realtime.crossfire.jxclient.queue.CommandQueue.sendNcom().

Here is the caller graph for this function:

◆ tick()

void com.realtime.crossfire.jxclient.map.PendingDirections.tick ( )

◆ toString()

String com.realtime.crossfire.jxclient.map.PendingDirections.toString ( )

Member Data Documentation

◆ pendingDirections

final List<@NotNull Rec> com.realtime.crossfire.jxclient.map.PendingDirections.pendingDirections = new ArrayList<>()
private

◆ runDirection

int com.realtime.crossfire.jxclient.map.PendingDirections.runDirection = -1
private

◆ state

State com.realtime.crossfire.jxclient.map.PendingDirections.state = State.IDLE
private

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