Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.map.AnimationState Class Reference

The state of an Animation on a map. More...

+ Inheritance diagram for com.realtime.crossfire.jxclient.map.AnimationState:
+ Collaboration diagram for com.realtime.crossfire.jxclient.map.AnimationState:

Public Member Functions

void allocate (@NotNull final MapUpdaterState mapUpdaterState, @NotNull final Location location)
 Adds this animation state to a map Location. More...
 
 AnimationState (@NotNull final Animation animation, final int index)
 Creates a new instance. More...
 
void free (@NotNull final Location location)
 Removes this animation state from a map Location. More...
 
Iterator< Locationiterator ()
 
void scroll (final int dx, final int dy, final int width, final int height)
 Scrolls all map locations. More...
 
void setSpeed (@NotNull final MapUpdaterState mapUpdaterState, final int speed)
 Sets the animation speed. More...
 
void setTickNo (final int tickNo)
 Sets the tick number. More...
 
void updateTickNo (@NotNull final MapUpdaterState mapUpdaterState, final int tickNo)
 Sets the tick number and update affected faces. More...
 

Private Member Functions

void updateFace (@NotNull final MapUpdaterState mapUpdaterState)
 Updates the map face from the state. More...
 

Private Attributes

final Animation animation
 The Animation to display. More...
 
int index
 The face index currently shown. More...
 
int lastFace = -1
 Records the last known face. More...
 
final Set< Locationlocations = new HashSet<>()
 All map locations this animation is displayed at. More...
 
int speed = 1
 The animation speed. More...
 
int tickNo
 The face was updated last in this tick number. More...
 

Detailed Description

The state of an Animation on a map.

Author
Andreas Kirschbaum

Definition at line 36 of file AnimationState.java.

Constructor & Destructor Documentation

◆ AnimationState()

com.realtime.crossfire.jxclient.map.AnimationState.AnimationState ( @NotNull final Animation  animation,
final int  index 
)

Creates a new instance.

Parameters
animationthe animation to display
indexthe initial face index

Definition at line 76 of file AnimationState.java.

References com.realtime.crossfire.jxclient.map.AnimationState.animation, and com.realtime.crossfire.jxclient.animations.Animation.getFaces().

+ Here is the call graph for this function:

Member Function Documentation

◆ allocate()

void com.realtime.crossfire.jxclient.map.AnimationState.allocate ( @NotNull final MapUpdaterState  mapUpdaterState,
@NotNull final Location  location 
)

Adds this animation state to a map Location.

Parameters
mapUpdaterStatethe map updater state instance to use
locationthe map location

Definition at line 142 of file AnimationState.java.

◆ free()

void com.realtime.crossfire.jxclient.map.AnimationState.free ( @NotNull final Location  location)

Removes this animation state from a map Location.

Parameters
locationthe location to free

Definition at line 155 of file AnimationState.java.

◆ iterator()

Iterator<Location> com.realtime.crossfire.jxclient.map.AnimationState.iterator ( )

Definition at line 166 of file AnimationState.java.

◆ scroll()

void com.realtime.crossfire.jxclient.map.AnimationState.scroll ( final int  dx,
final int  dy,
final int  width,
final int  height 
)

Scrolls all map locations.

Parameters
dxthe x distance to scroll
dythe y distance to scroll
widththe map width
heightthe map height

Definition at line 177 of file AnimationState.java.

◆ setSpeed()

void com.realtime.crossfire.jxclient.map.AnimationState.setSpeed ( @NotNull final MapUpdaterState  mapUpdaterState,
final int  speed 
)

Sets the animation speed.

Parameters
mapUpdaterStatethe map updater state instance to use
speedthe new animation speed to set

Definition at line 86 of file AnimationState.java.

References com.realtime.crossfire.jxclient.map.AnimationState.speed, and com.realtime.crossfire.jxclient.map.AnimationState.updateFace().

Referenced by com.realtime.crossfire.jxclient.map.AnimationMap.updateSpeed().

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

◆ setTickNo()

void com.realtime.crossfire.jxclient.map.AnimationState.setTickNo ( final int  tickNo)

Sets the tick number.

This function does not update the displayed face.

Parameters
tickNothe current tick number

Definition at line 102 of file AnimationState.java.

References com.realtime.crossfire.jxclient.map.AnimationState.tickNo.

◆ updateFace()

void com.realtime.crossfire.jxclient.map.AnimationState.updateFace ( @NotNull final MapUpdaterState  mapUpdaterState)
private

Updates the map face from the state.

Parameters
mapUpdaterStatethe map updater state instance to use

Definition at line 126 of file AnimationState.java.

References com.realtime.crossfire.jxclient.animations.Animation.getFace().

Referenced by com.realtime.crossfire.jxclient.map.AnimationState.setSpeed(), and com.realtime.crossfire.jxclient.map.AnimationState.updateTickNo().

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

◆ updateTickNo()

void com.realtime.crossfire.jxclient.map.AnimationState.updateTickNo ( @NotNull final MapUpdaterState  mapUpdaterState,
final int  tickNo 
)

Sets the tick number and update affected faces.

Parameters
mapUpdaterStatethe map updater state instance to use
tickNothe tick number

Definition at line 111 of file AnimationState.java.

References com.realtime.crossfire.jxclient.animations.Animation.getFaces(), com.realtime.crossfire.jxclient.map.AnimationState.tickNo, and com.realtime.crossfire.jxclient.map.AnimationState.updateFace().

+ Here is the call graph for this function:

Member Data Documentation

◆ animation

final Animation com.realtime.crossfire.jxclient.map.AnimationState.animation
private

◆ index

int com.realtime.crossfire.jxclient.map.AnimationState.index
private

The face index currently shown.

May contain values between 0 and speed*animation.getFaces() (exclusive).

Definition at line 58 of file AnimationState.java.

◆ lastFace

int com.realtime.crossfire.jxclient.map.AnimationState.lastFace = -1
private

Records the last known face.

Used to suppress redundant map updates.

Definition at line 63 of file AnimationState.java.

◆ locations

final Set<Location> com.realtime.crossfire.jxclient.map.AnimationState.locations = new HashSet<>()
private

All map locations this animation is displayed at.

Definition at line 69 of file AnimationState.java.

◆ speed

int com.realtime.crossfire.jxclient.map.AnimationState.speed = 1
private

The animation speed.

Definition at line 47 of file AnimationState.java.

Referenced by com.realtime.crossfire.jxclient.map.AnimationState.setSpeed().

◆ tickNo

int com.realtime.crossfire.jxclient.map.AnimationState.tickNo
private

The face was updated last in this tick number.

Definition at line 52 of file AnimationState.java.

Referenced by com.realtime.crossfire.jxclient.map.AnimationState.setTickNo(), and com.realtime.crossfire.jxclient.map.AnimationState.updateTickNo().


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