 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.map;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.stream.Collectors;
28 import org.jetbrains.annotations.NotNull;
103 public void add(
final int direction,
final int packetNo) {
113 public void run(
final int direction) {
123 public void comc(
final int packetNo) {
224 private static class Rec {
State state
The current state when waiting for server responses.
PendingDirections()
Creates a new instance.
final int direction
The direction of the step.
Rec(final int direction, final int packetNo)
Creates a new instance.
void reset()
Resets the state.
final List< @NotNull Rec > pendingDirections
Records the directions of sent movement commands which have not yet been executed by the server.
int getPacketNo()
Returns the packet number of the corresponding ncom message.
int getRunDirection()
Returns the direction the character is running.
void add(final int direction, final int packetNo)
Adds a pending step.
void tick()
Must be called when a tick message has been received.
IDLE
Not expecting any server response.
EXPECT_MAP_SCROLL_OR_TICK
Expecting a scrolled map.
Maintains pending movements of the character.
EXPECT_TICK
Expecting a tick message.
int getDirection()
Returns the direction of the step.
void mapScroll(final int direction)
Must be called when the map has been scrolled.
void run(final int direction)
Sets the directions the character is currently running to.
The state for tracking server responses.
void comc(final int packetNo)
Must be called when a comc message has been received from the server.
int runDirection
The direction the character is running or -1 when not running.
final int packetNo
The packet number of the corresponding ncom message.
void clear()
Clears the state.
Iterable< @NotNull Integer > getPendingDirections()
Returns the currently pending directions.