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

Represents a map (as seen by the client). More...

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

Public Member Functions

void clearSquare (final int x, final int y)
 Clears the content of one square. More...
 
void dirty (final int x, final int y)
 Marks a single square as dirty. More...
 
int getColor (final int x, final int y)
 Returns the magic map color value of one square. More...
 
int getDarkness (final int x, final int y)
 Returns the darkness value of one square. More...
 
Set< CfMapSquaregetDirtyMapSquares ()
 Returns the dirty map squares. More...
 
Face getFace (final int x, final int y, final int layer)
 Determines the face of one square. More...
 
CfMapSquare getHeadMapSquare (final int x, final int y, final int layer)
 Returns the map square of the head of a multi-square object. More...
 
CfMapSquare getMapSquare (final int x, final int y)
 Returns a map square. More...
 
CfMapSquare getMapSquareUnlessDirty (final int x, final int y)
 Returns a map square. More...
 
int getOffsetX ()
 Returns the offset to convert an absolute x-coordinate of a map square (CfMapSquare#getX() to a relative x-coordinate. More...
 
int getOffsetY ()
 Returns the offset to convert an absolute y-coordinate of a map square (CfMapSquare#getY() to a relative y-coordinate. More...
 
int getSmooth (final int x, final int y, final int layer)
 Returns the smooth value of one square. More...
 
boolean isFogOfWar (final int x, final int y)
 Determines if the tile is not up-to-date. More...
 
boolean processMapScroll (final int dx, final int dy, final int width, final int height)
 Processes a map scroll command. More...
 
void reset (final int mapWidth, final int mapHeight)
 Clears the map contents. More...
 
void setDarkness (final int x, final int y, final int darkness)
 Sets the darkness value of one square. More...
 
void setFace (final int x, final int y, final int layer, @Nullable final Face face)
 Sets the face of one square. More...
 
void setMagicMap (final int x0, final int y0, final byte[][] data)
 Sets the magic map color of one square. More...
 
void setSmooth (final int x, final int y, final int layer, final int smooth)
 Sets the smooth value of one square. More...
 
void squareModified (@NotNull final CfMapSquare mapSquare)
 Marks a CfMapSquare as dirty. More...
 
void squarePendingFace (final int x, final int y, final int faceNum)
 Marks a CfMapSquare as containing a pending face. More...
 
void updateFace (final int faceNum, final int width, final int height)
 Processes an updated face image. More...
 

Private Member Functions

CfMapPatch [][] copyPatches (final int newWidth, final int newHeight, final int offsetX, final int offsetY, final int height, final int width)
 Returns a copy of a rectangular area of patch. More...
 
void dirtyFace (final int x, final int y, final int layer, @NotNull final Face face)
 Marks one face as "dirty". More...
 
void expandFace (final int x, final int y, final int layer, @NotNull final Face face, @NotNull final CfMapSquare oldMapSquare, @Nullable final CfMapSquare newMapSquare)
 Adds or removes "head" pointer to/from tail-parts of a face. More...
 
CfMapPatch expandTo (final int x, final int y)
 (Possibly) expands the defined area of the map to a given position. More...
 
CfMapPatch getMapPatch (final int x, final int y)
 Checks if a given position is within the defined map area. More...
 
void increase (final int dx, final int dy)
 Increases the defined area of the map. More...
 
void scroll (final int dx, final int dy)
 Scrolls the map. More...
 
void setFaceInternal (final int x, final int y, final int layer, @Nullable final Face face)
 Sets the face of one square. More...
 
void setHeadMapSquare (final int x, final int y, final int layer, @Nullable final CfMapSquare mapSquare, final boolean setAlways)
 Sets the map square containing the head face for a layer. More...
 

Static Private Member Functions

static int size (final int min, final int max)
 Calculates the number of patches needed to hold tiles between two patch coordinates. More...
 

Private Attributes

final Set< CfMapSquaredirtyMapSquares = new HashSet<>()
 The "dirty" map squares that have been modified. More...
 
int maxPx = -1
 The right edge of the defined patches in patch. More...
 
int maxPy = -1
 The bottom edge of the defined patches in patch. More...
 
int maxX = -1
 The right edge of the defined tiles. More...
 
int maxY = -1
 The bottom edge of the defined tiles. More...
 
int minPx
 The left edge of the defined patches in patch. More...
 
int minPy
 The top edge of the defined patches in patch. More...
 
int minX
 The left edge of the defined tiles. More...
 
int minY
 The top edge of the defined tiles. More...
 
int ox
 Result values for getMapPatch(int, int) and expandTo(int, int). More...
 
int oy
 Result values for getMapPatch(int, int) and expandTo(int, int). More...
 
CfMapPatch [][] patch
 Array of (possibly) defined squares. More...
 
int patchX
 Left edge of viewable area. More...
 
int patchY
 Top edge of viewable area. More...
 
final Map< Integer, Collection< CfMapSquare > > pendingFaceSquares = new HashMap<>()
 The map squares containing pending faces. More...
 

Detailed Description

Represents a map (as seen by the client).

A map is a grid in which CfMapSquares can be stored.

The map will be automatically enlarged by accesses to new squares. Not yet set squares are considered dark.

All accesses must be synchronized on the map instance.

Author
Andreas Kirschbaum

Definition at line 45 of file CfMap.java.

Member Function Documentation

◆ clearSquare()

void com.realtime.crossfire.jxclient.map.CfMap.clearSquare ( final int  x,
final int  y 
)

Clears the content of one square.

Note: the old square content remains available until at least one value will be changed ("fog of war").

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square

Definition at line 390 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapPatch.clearSquare(), com.realtime.crossfire.jxclient.map.CfMap.dirtyFace(), com.realtime.crossfire.jxclient.map.CfMap.expandTo(), com.realtime.crossfire.jxclient.map.CfMapPatch.getFace(), and com.realtime.crossfire.jxclient.protocol.Map2.NUM_LAYERS.

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapClear(), com.realtime.crossfire.jxclient.map.CfMap.processMapScroll(), and com.realtime.crossfire.jxclient.map.CfMap.reset().

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

◆ copyPatches()

CfMapPatch [][] com.realtime.crossfire.jxclient.map.CfMap.copyPatches ( final int  newWidth,
final int  newHeight,
final int  offsetX,
final int  offsetY,
final int  height,
final int  width 
)
private

Returns a copy of a rectangular area of patch.

Parameters
newWidththe width of the new area
newHeightthe height of the new area
offsetXthe x-offset into the new area
offsetYthe y-offset into the new area
heightthe height of the area to copy
widththe width of the area to copy
Returns
the copy

Definition at line 717 of file CfMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMap.increase().

+ Here is the caller graph for this function:

◆ dirty()

void com.realtime.crossfire.jxclient.map.CfMap.dirty ( final int  x,
final int  y 
)

Marks a single square as dirty.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square

Definition at line 407 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapPatch.dirty(), and com.realtime.crossfire.jxclient.map.CfMap.expandTo().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.dirtyFace(), com.realtime.crossfire.jxclient.map.CfMap.setFace(), and com.realtime.crossfire.jxclient.map.CfMap.updateFace().

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

◆ dirtyFace()

void com.realtime.crossfire.jxclient.map.CfMap.dirtyFace ( final int  x,
final int  y,
final int  layer,
@NotNull final Face  face 
)
private

Marks one face as "dirty".

This function is called when the head part becomes a fog-of-war tile. This means the face has to be redrawn.

Parameters
xthe x-coordinate of the tail part of the face
ythe y-coordinate of the tail part of the face
layerthe layer of the face
facethe face to mark dirty

Definition at line 324 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.dirty(), com.realtime.crossfire.jxclient.map.CfMap.isFogOfWar(), and com.realtime.crossfire.jxclient.map.CfMap.setHeadMapSquare().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.clearSquare().

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

◆ expandFace()

void com.realtime.crossfire.jxclient.map.CfMap.expandFace ( final int  x,
final int  y,
final int  layer,
@NotNull final Face  face,
@NotNull final CfMapSquare  oldMapSquare,
@Nullable final CfMapSquare  newMapSquare 
)
private

Adds or removes "head" pointer to/from tail-parts of a face.

Parameters
xthe x-coordinate of the tail part to expand
ythe y-coordinate of the tail part to expand
layerthe layer to expand
facethe face to expand
oldMapSquarethe map square of the tail part
newMapSquarethe map square of the tail part to add pointers, or
null
to remove pointers

Definition at line 300 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.getHeadMapSquare(), and com.realtime.crossfire.jxclient.map.CfMap.setHeadMapSquare().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.setFaceInternal().

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

◆ expandTo()

CfMapPatch com.realtime.crossfire.jxclient.map.CfMap.expandTo ( final int  x,
final int  y 
)
private

◆ getColor()

int com.realtime.crossfire.jxclient.map.CfMap.getColor ( final int  x,
final int  y 
)

Returns the magic map color value of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
Returns
the color

Definition at line 243 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.DEFAULT_COLOR, com.realtime.crossfire.jxclient.map.CfMapPatch.getColor(), and com.realtime.crossfire.jxclient.map.CfMap.getMapPatch().

+ Here is the call graph for this function:

◆ getDarkness()

int com.realtime.crossfire.jxclient.map.CfMap.getDarkness ( final int  x,
final int  y 
)

Returns the darkness value of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
Returns
the darkness value of the square; 0=dark, 255=full bright; not yet set faces return 0

Definition at line 175 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.DEFAULT_DARKNESS, com.realtime.crossfire.jxclient.map.CfMapPatch.getDarkness(), and com.realtime.crossfire.jxclient.map.CfMap.getMapPatch().

+ Here is the call graph for this function:

◆ getDirtyMapSquares()

Set<CfMapSquare> com.realtime.crossfire.jxclient.map.CfMap.getDirtyMapSquares ( )

Returns the dirty map squares.

The result may be modified by the caller.

Returns
the dirty map squares

Definition at line 759 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.dirtyMapSquares.

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapEnd().

+ Here is the caller graph for this function:

◆ getFace()

Face com.realtime.crossfire.jxclient.map.CfMap.getFace ( final int  x,
final int  y,
final int  layer 
)

Determines the face of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
layerthe layer of the face
Returns
the face; dark (i.e. not yet set) faces return
null

Definition at line 348 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.DEFAULT_FACE, com.realtime.crossfire.jxclient.map.CfMapPatch.getFace(), and com.realtime.crossfire.jxclient.map.CfMap.getMapPatch().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.updateFace().

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

◆ getHeadMapSquare()

CfMapSquare com.realtime.crossfire.jxclient.map.CfMap.getHeadMapSquare ( final int  x,
final int  y,
final int  layer 
)

Returns the map square of the head of a multi-square object.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
layerthe layer to return the head for
Returns
the head map square, or
null
if this square does not contain a multi-tail

Definition at line 378 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapPatch.getHeadMapSquare(), and com.realtime.crossfire.jxclient.map.CfMap.getMapPatch().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.expandFace().

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

◆ getMapPatch()

◆ getMapSquare()

CfMapSquare com.realtime.crossfire.jxclient.map.CfMap.getMapSquare ( final int  x,
final int  y 
)

Returns a map square.

Parameters
xthe x-coordinate
ythe y-coordinate
Returns
the map square

Definition at line 668 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.expandTo(), and com.realtime.crossfire.jxclient.map.CfMapPatch.getSquare().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.getMapSquareUnlessDirty(), com.realtime.crossfire.jxclient.gui.map.GUIMiniMap.markPlayer(), com.realtime.crossfire.jxclient.map.CfMap.setSmooth(), and com.realtime.crossfire.jxclient.map.CfMap.squarePendingFace().

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

◆ getMapSquareUnlessDirty()

CfMapSquare com.realtime.crossfire.jxclient.map.CfMap.getMapSquareUnlessDirty ( final int  x,
final int  y 
)

Returns a map square.

Parameters
xthe x-coordinate
ythe y-coordinate
Returns
the map square or
null
if it would be dirty

Definition at line 680 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.getMapSquare().

+ Here is the call graph for this function:

◆ getOffsetX()

int com.realtime.crossfire.jxclient.map.CfMap.getOffsetX ( )

Returns the offset to convert an absolute x-coordinate of a map square (CfMapSquare#getX() to a relative x-coordinate.

Returns
the x offset

Definition at line 691 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.patchX.

◆ getOffsetY()

int com.realtime.crossfire.jxclient.map.CfMap.getOffsetY ( )

Returns the offset to convert an absolute y-coordinate of a map square (CfMapSquare#getY() to a relative y-coordinate.

Returns
the y offset

Definition at line 701 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.patchY.

◆ getSmooth()

int com.realtime.crossfire.jxclient.map.CfMap.getSmooth ( final int  x,
final int  y,
final int  layer 
)

Returns the smooth value of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
layerthe layer of the square
Returns
the smooth value of the square

Definition at line 211 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.DEFAULT_SMOOTH, com.realtime.crossfire.jxclient.map.CfMap.getMapPatch(), and com.realtime.crossfire.jxclient.map.CfMapPatch.getSmooth().

+ Here is the call graph for this function:

◆ increase()

void com.realtime.crossfire.jxclient.map.CfMap.increase ( final int  dx,
final int  dy 
)
private

Increases the defined area of the map.

Parameters
dxthe increase in x-direction; dx<0 means "expand (-dx) tiles to the left", dx>0 means "expand (dx) tiles to the right"
dythe increase in y-direction; dy<0 means "expand (-dy) tiles to the top", dy>0 means "expand (dy) tiles to the bottom"

Definition at line 532 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.copyPatches(), com.realtime.crossfire.jxclient.map.CfMap.patchX, com.realtime.crossfire.jxclient.map.CfMap.patchY, com.realtime.crossfire.jxclient.map.CfMap.size(), and com.realtime.crossfire.jxclient.map.CfMapPatch.SIZE_LOG.

Referenced by com.realtime.crossfire.jxclient.map.CfMap.expandTo().

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

◆ isFogOfWar()

boolean com.realtime.crossfire.jxclient.map.CfMap.isFogOfWar ( final int  x,
final int  y 
)

Determines if the tile is not up-to-date.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
Returns
whether the tile contains fog-of-war data

Definition at line 418 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.getMapPatch(), and com.realtime.crossfire.jxclient.map.CfMapPatch.isFogOfWar().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.dirtyFace().

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

◆ processMapScroll()

boolean com.realtime.crossfire.jxclient.map.CfMap.processMapScroll ( final int  dx,
final int  dy,
final int  width,
final int  height 
)

Processes a map scroll command.

Parameters
dxthe distance to scroll in x-direction in squares
dythe distance to scroll in y-direction in squares
widththe width of the visible map area in map squares
heightthe height of the visible map area in map squares
Returns
whether scrolling did clear the whole visible map area

Definition at line 799 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.clearSquare(), and com.realtime.crossfire.jxclient.map.CfMap.scroll().

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapScroll().

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

◆ reset()

void com.realtime.crossfire.jxclient.map.CfMap.reset ( final int  mapWidth,
final int  mapHeight 
)

Clears the map contents.

Parameters
mapWidththe width of the visible map area
mapHeightthe height of the visible map area

Definition at line 133 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.clearSquare().

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.newMap().

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

◆ scroll()

void com.realtime.crossfire.jxclient.map.CfMap.scroll ( final int  dx,
final int  dy 
)
private

Scrolls the map.

Parameters
dxthe x-difference to scroll
dythe y-difference to scroll

Definition at line 469 of file CfMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMap.processMapScroll().

+ Here is the caller graph for this function:

◆ setDarkness()

void com.realtime.crossfire.jxclient.map.CfMap.setDarkness ( final int  x,
final int  y,
final int  darkness 
)

Sets the darkness value of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
darknessthe darkness value to set; 0=dark, 255=full bright

Definition at line 159 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.DEFAULT_FACE, com.realtime.crossfire.jxclient.map.CfMap.expandTo(), com.realtime.crossfire.jxclient.protocol.Map2.NUM_LAYERS, and com.realtime.crossfire.jxclient.map.CfMap.setFaceInternal().

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapDarkness(), and com.realtime.crossfire.jxclient.map.CfMap.setFace().

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

◆ setFace()

void com.realtime.crossfire.jxclient.map.CfMap.setFace ( final int  x,
final int  y,
final int  layer,
@Nullable final Face  face 
)

◆ setFaceInternal()

void com.realtime.crossfire.jxclient.map.CfMap.setFaceInternal ( final int  x,
final int  y,
final int  layer,
@Nullable final Face  face 
)
private

Sets the face of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
layerthe layer to set
facethe face to set; may be
null
to remove the face

Definition at line 277 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.expandFace(), com.realtime.crossfire.jxclient.map.CfMap.expandTo(), com.realtime.crossfire.jxclient.map.CfMapSquare.getFace(), com.realtime.crossfire.jxclient.map.CfMapPatch.getSquare(), and com.realtime.crossfire.jxclient.map.CfMapSquare.setFace().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.setDarkness(), com.realtime.crossfire.jxclient.map.CfMap.setFace(), com.realtime.crossfire.jxclient.map.CfMap.setMagicMap(), and com.realtime.crossfire.jxclient.map.CfMap.setSmooth().

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

◆ setHeadMapSquare()

void com.realtime.crossfire.jxclient.map.CfMap.setHeadMapSquare ( final int  x,
final int  y,
final int  layer,
@Nullable final CfMapSquare  mapSquare,
final boolean  setAlways 
)
private

Sets the map square containing the head face for a layer.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
layerthe layer for the new head face between
0
and
LAYERS-1
mapSquarethe map square containing the head face; may be
null
setAlwaysif set, always update the face; if unset, only update when fog-of-war

Definition at line 365 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.expandTo(), and com.realtime.crossfire.jxclient.map.CfMapPatch.setHeadMapSquare().

Referenced by com.realtime.crossfire.jxclient.map.CfMap.dirtyFace(), and com.realtime.crossfire.jxclient.map.CfMap.expandFace().

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

◆ setMagicMap()

void com.realtime.crossfire.jxclient.map.CfMap.setMagicMap ( final int  x0,
final int  y0,
final byte  data[][] 
)

Sets the magic map color of one square.

Parameters
x0the x-coordinate of the square
y0the y-coordinate of the square
datathe magic map data (y, x); will not be changed

Definition at line 223 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.DEFAULT_FACE, com.realtime.crossfire.jxclient.map.CfMap.expandTo(), com.realtime.crossfire.jxclient.protocol.MagicMap.FACE_COLOR_MASK, com.realtime.crossfire.jxclient.protocol.Map2.NUM_LAYERS, and com.realtime.crossfire.jxclient.map.CfMap.setFaceInternal().

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.magicMap().

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

◆ setSmooth()

void com.realtime.crossfire.jxclient.map.CfMap.setSmooth ( final int  x,
final int  y,
final int  layer,
final int  smooth 
)

Sets the smooth value of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
layerthe layer to set
smooththe smooth value to set

Definition at line 188 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.DEFAULT_FACE, com.realtime.crossfire.jxclient.map.CfMap.expandTo(), com.realtime.crossfire.jxclient.map.CfMap.getMapSquare(), com.realtime.crossfire.jxclient.protocol.Map2.NUM_LAYERS, com.realtime.crossfire.jxclient.map.CfMap.setFaceInternal(), com.realtime.crossfire.jxclient.map.CfMapPatch.setSmooth(), and com.realtime.crossfire.jxclient.map.CfMap.squareModified().

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.mapSmooth().

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

◆ size()

static int com.realtime.crossfire.jxclient.map.CfMap.size ( final int  min,
final int  max 
)
staticprivate

Calculates the number of patches needed to hold tiles between two patch coordinates.

Parameters
minthe minimum coordinate
maxthe maximum coordinate
Returns
the number of patches

Definition at line 657 of file CfMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMap.increase().

+ Here is the caller graph for this function:

◆ squareModified()

void com.realtime.crossfire.jxclient.map.CfMap.squareModified ( @NotNull final CfMapSquare  mapSquare)

Marks a CfMapSquare as dirty.

Parameters
mapSquarethe map square

Definition at line 732 of file CfMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMapSquare.dirty(), and com.realtime.crossfire.jxclient.map.CfMap.setSmooth().

+ Here is the caller graph for this function:

◆ squarePendingFace()

void com.realtime.crossfire.jxclient.map.CfMap.squarePendingFace ( final int  x,
final int  y,
final int  faceNum 
)

Marks a CfMapSquare as containing a pending face.

Parameters
xthe x coordinate of the map square
ythe y coordinate of the map square
faceNumthe pending face

Definition at line 743 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.getMapSquare().

+ Here is the call graph for this function:

◆ updateFace()

void com.realtime.crossfire.jxclient.map.CfMap.updateFace ( final int  faceNum,
final int  width,
final int  height 
)

Processes an updated face image.

Parameters
faceNumthe face that has changed
widththe width of the visible map area
heightthe height of the visible map area

Definition at line 772 of file CfMap.java.

References com.realtime.crossfire.jxclient.map.CfMap.dirty(), com.realtime.crossfire.jxclient.map.CfMap.getFace(), com.realtime.crossfire.jxclient.faces.Face.getFaceNum(), com.realtime.crossfire.jxclient.protocol.Map2.NUM_LAYERS, and com.realtime.crossfire.jxclient.map.CfMap.setFace().

Referenced by com.realtime.crossfire.jxclient.map.MapUpdaterState.faceUpdated().

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

Member Data Documentation

◆ dirtyMapSquares

final Set<CfMapSquare> com.realtime.crossfire.jxclient.map.CfMap.dirtyMapSquares = new HashSet<>()
private

The "dirty" map squares that have been modified.

Definition at line 119 of file CfMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMap.getDirtyMapSquares().

◆ maxPx

int com.realtime.crossfire.jxclient.map.CfMap.maxPx = -1
private

The right edge of the defined patches in patch.

Definition at line 75 of file CfMap.java.

◆ maxPy

int com.realtime.crossfire.jxclient.map.CfMap.maxPy = -1
private

The bottom edge of the defined patches in patch.

Definition at line 85 of file CfMap.java.

◆ maxX

int com.realtime.crossfire.jxclient.map.CfMap.maxX = -1
private

The right edge of the defined tiles.

Definition at line 55 of file CfMap.java.

◆ maxY

int com.realtime.crossfire.jxclient.map.CfMap.maxY = -1
private

The bottom edge of the defined tiles.

Definition at line 65 of file CfMap.java.

◆ minPx

int com.realtime.crossfire.jxclient.map.CfMap.minPx
private

The left edge of the defined patches in patch.

Definition at line 70 of file CfMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMap.getMapPatch().

◆ minPy

int com.realtime.crossfire.jxclient.map.CfMap.minPy
private

The top edge of the defined patches in patch.

Definition at line 80 of file CfMap.java.

Referenced by com.realtime.crossfire.jxclient.map.CfMap.expandTo(), and com.realtime.crossfire.jxclient.map.CfMap.getMapPatch().

◆ minX

int com.realtime.crossfire.jxclient.map.CfMap.minX
private

The left edge of the defined tiles.

Definition at line 50 of file CfMap.java.

◆ minY

int com.realtime.crossfire.jxclient.map.CfMap.minY
private

The top edge of the defined tiles.

Definition at line 60 of file CfMap.java.

◆ ox

int com.realtime.crossfire.jxclient.map.CfMap.ox
private

Result values for getMapPatch(int, int) and expandTo(int, int).

Definition at line 91 of file CfMap.java.

◆ oy

int com.realtime.crossfire.jxclient.map.CfMap.oy
private

Result values for getMapPatch(int, int) and expandTo(int, int).

Definition at line 97 of file CfMap.java.

◆ patch

CfMapPatch [][] com.realtime.crossfire.jxclient.map.CfMap.patch
private

Array of (possibly) defined squares.

Definition at line 113 of file CfMap.java.

◆ patchX

◆ patchY

int com.realtime.crossfire.jxclient.map.CfMap.patchY
private

◆ pendingFaceSquares

final Map<Integer, Collection<CfMapSquare> > com.realtime.crossfire.jxclient.map.CfMap.pendingFaceSquares = new HashMap<>()
private

The map squares containing pending faces.

Maps face number to map squares that need to be repainted when the face becomes available.

Definition at line 126 of file CfMap.java.


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