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

Maintains AnimationState instances for map locations. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.map.AnimationMap:

Public Member Functions

void add (@NotNull final MapUpdaterState mapUpdaterState, @NotNull final Location location, @NotNull final AnimationState animationState)
 Adds a new AnimationState to a Location. More...
 
void clear ()
 Forgets all state. More...
 
void remove (@NotNull final Location location)
 Clears a Location. More...
 
void scroll (final int dx, final int dy, final int width, final int height)
 Scrolls all locations. More...
 
void updateSpeed (@NotNull final MapUpdaterState mapUpdaterState, @NotNull final Location location, final int speed)
 Updates the animation speed value of a Location. More...
 

Static Private Member Functions

static void freeAnimationState (@Nullable final AnimationState animationState, @NotNull final Location location)
 Calls AnimationState#free(Location). More...
 

Private Attributes

final Map< Location, AnimationStateanimations = new HashMap<>()
 The active AnimationState instances. More...
 

Detailed Description

Maintains AnimationState instances for map locations.

Author
Andreas Kirschbaum

Definition at line 35 of file AnimationMap.java.

Member Function Documentation

◆ add()

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

Adds a new AnimationState to a Location.

If the location was not empty, the previous animation state is freed.

Parameters
mapUpdaterStatethe map updater state instance to use
locationthe location to add to
animationStatethe animation state to add

Definition at line 58 of file AnimationMap.java.

References com.realtime.crossfire.jxclient.map.AnimationMap.freeAnimationState().

Referenced by com.realtime.crossfire.jxclient.map.CfMapAnimations.add().

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

◆ clear()

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

Forgets all state.

Definition at line 47 of file AnimationMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMapAnimations.clear().

+ Here is the caller graph for this function:

◆ freeAnimationState()

static void com.realtime.crossfire.jxclient.map.AnimationMap.freeAnimationState ( @Nullable final AnimationState  animationState,
@NotNull final Location  location 
)
staticprivate

Calls AnimationState#free(Location).

Parameters
animationStatethe instance to call
free()
on or
null
to do nothing
locationthe location to pass

Definition at line 111 of file AnimationMap.java.

Referenced by com.realtime.crossfire.jxclient.map.AnimationMap.add(), and com.realtime.crossfire.jxclient.map.AnimationMap.remove().

+ Here is the caller graph for this function:

◆ remove()

void com.realtime.crossfire.jxclient.map.AnimationMap.remove ( @NotNull final Location  location)

Clears a Location.

Parameters
locationthe location to clear

Definition at line 67 of file AnimationMap.java.

References com.realtime.crossfire.jxclient.map.AnimationMap.freeAnimationState().

Referenced by com.realtime.crossfire.jxclient.map.CfMapAnimations.remove().

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

◆ scroll()

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

Scrolls all locations.

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

Definition at line 94 of file AnimationMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMapAnimations.scroll().

+ Here is the caller graph for this function:

◆ updateSpeed()

void com.realtime.crossfire.jxclient.map.AnimationMap.updateSpeed ( @NotNull final MapUpdaterState  mapUpdaterState,
@NotNull final Location  location,
final int  speed 
)

Updates the animation speed value of a Location.

Parameters
mapUpdaterStatethe map updater state instance to use
locationthe location to update
speedthe new animation speed

Definition at line 77 of file AnimationMap.java.

References com.realtime.crossfire.jxclient.map.AnimationState.setSpeed().

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

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

Member Data Documentation

◆ animations

final Map<Location, AnimationState> com.realtime.crossfire.jxclient.map.AnimationMap.animations = new HashMap<>()
private

The active AnimationState instances.

Maps map Location to

AnimationState

instance.

Definition at line 42 of file AnimationMap.java.


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