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

Public Member Functions

void allocate (@NotNull final Location location)
 
void allocate (final int tag)
 
 AnimationState (@NotNull final Animation animation, final int index, @NotNull final CfAnimationsMapListener mapListener, @NotNull final ItemSet itemSet, @NotNull final FacesManager facesManager)
 
void free (@NotNull final Location location)
 
void free (final int tag)
 
void freeAllLocations ()
 
Iterator< Locationiterator ()
 
void scroll (final int dx, final int dy, final int width, final int height)
 
void setSpeed (final int speed)
 
void setTickNo (final int tickNo)
 
void updateTickNo (final int tickNo)
 

Private Member Functions

void updateFace ()
 

Private Attributes

final Animation animation
 
final FacesManager facesManager
 
int index
 
final ItemSet itemSet
 
int lastFace = -1
 
final Set< Locationlocations = new HashSet<>()
 
final CfAnimationsMapListener mapListener
 
int speed = 1
 
final Collection< Integer > tags = new HashSet<>()
 
int tickNo
 

Detailed Description

The state of an Animation on a map.

Author
Andreas Kirschbaum

Definition at line 41 of file AnimationState.java.

Constructor & Destructor Documentation

◆ AnimationState()

com.realtime.crossfire.jxclient.map.AnimationState.AnimationState ( @NotNull final Animation  animation,
final int  index,
@NotNull final CfAnimationsMapListener  mapListener,
@NotNull final ItemSet  itemSet,
@NotNull final FacesManager  facesManager 
)

Creates a new instance.

Parameters
animationthe animation to display
indexthe initial face index
mapListenerthe map listener to notify of changes
itemSetthe item set to notify of changes
facesManagerthe faces manager to track for updated faces

Definition at line 108 of file AnimationState.java.

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

Here is the call graph for this function:

Member Function Documentation

◆ allocate() [1/2]

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

◆ allocate() [2/2]

void com.realtime.crossfire.jxclient.map.AnimationState.allocate ( final int  tag)

◆ free() [1/2]

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 203 of file AnimationState.java.

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

◆ free() [2/2]

void com.realtime.crossfire.jxclient.map.AnimationState.free ( final int  tag)

Removes this animation state from an item tag.

Parameters
tagthe item tag to free

Definition at line 220 of file AnimationState.java.

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

◆ freeAllLocations()

void com.realtime.crossfire.jxclient.map.AnimationState.freeAllLocations ( )

Removes this animation state from all map Locations.

Definition at line 212 of file AnimationState.java.

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

◆ iterator()

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

◆ 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 239 of file AnimationState.java.

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

◆ setSpeed()

void com.realtime.crossfire.jxclient.map.AnimationState.setSpeed ( final int  speed)

Sets the animation speed.

Parameters
speedthe new animation speed to set

Definition at line 120 of file AnimationState.java.

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

Referenced by com.realtime.crossfire.jxclient.map.AnimationSet.updateSpeed(), and 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 136 of file AnimationState.java.

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

◆ updateFace()

void com.realtime.crossfire.jxclient.map.AnimationState.updateFace ( )
private

◆ updateTickNo()

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

Member Data Documentation

◆ animation

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

◆ facesManager

final FacesManager com.realtime.crossfire.jxclient.map.AnimationState.facesManager
private

◆ index

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

◆ itemSet

final ItemSet com.realtime.crossfire.jxclient.map.AnimationState.itemSet
private

◆ 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 86 of file AnimationState.java.

Referenced by com.realtime.crossfire.jxclient.map.AnimationState.allocate(), and com.realtime.crossfire.jxclient.map.AnimationState.updateFace().

◆ locations

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

◆ mapListener

final CfAnimationsMapListener com.realtime.crossfire.jxclient.map.AnimationState.mapListener
private

◆ speed

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

◆ tags

final Collection<Integer> com.realtime.crossfire.jxclient.map.AnimationState.tags = new HashSet<>()
private

◆ tickNo

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

The face was updated last in this tick number.

Definition at line 75 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: