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

Represents a square area of CfMapSquares. More...

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

Public Member Functions

 CfMapPatch (@NotNull final CfMap map, final int x0, final int y0)
 Creates a new (empty) patch. More...
 
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 square as dirty. More...
 
int getColor (final int x, final int y)
 Determines the magic map color value of one square. More...
 
int getDarkness (final int x, final int y)
 Determines the darkness value of one square. 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...
 
int getSmooth (final int x, final int y, final int layer)
 Determines the smooth value of one square. More...
 
CfMapSquare getSquare (final int x, final int y)
 Returns one map square. More...
 
boolean isFogOfWar (final int x, final int y)
 Determines if a square is not up-to-date. More...
 
boolean resetFogOfWar (final int x, final int y)
 Returns and reset the "fog-of-war" flag of a square. More...
 
boolean setColor (final int x, final int y, final int color)
 Sets the magic map color of one square. More...
 
boolean setDarkness (final int x, final int y, final int darkness)
 Sets the darkness value 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...
 
int setSmooth (final int x, final int y, final int layer, final int smooth)
 Sets the smooth value of one square. More...
 

Static Public Attributes

static final int SIZE = 1<<SIZE_LOG
 Size of patches in x- and y-direction. More...
 
static final int SIZE_LOG = 5
 Log2 of SIZE. More...
 

Private Attributes

final CfMapSquare [][] square = new CfMapSquare[SIZE][SIZE]
 The array of CfMapSquares. More...
 

Detailed Description

Represents a square area of CfMapSquares.

Author
Andreas Kirschbaum

Definition at line 32 of file CfMapPatch.java.

Constructor & Destructor Documentation

◆ CfMapPatch()

com.realtime.crossfire.jxclient.map.CfMapPatch.CfMapPatch ( @NotNull final CfMap  map,
final int  x0,
final int  y0 
)

Creates a new (empty) patch.

Parameters
mapthe map this map patch is part of
x0the absolute map x-coordinate of the top left corner of this patch
y0the absolute map y-coordinate of the top left corner of this patch

Definition at line 59 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapPatch.SIZE.

Member Function Documentation

◆ clearSquare()

void com.realtime.crossfire.jxclient.map.CfMapPatch.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 82 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.clear().

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:

◆ dirty()

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

Marks a square as dirty.

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

Definition at line 72 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.dirty().

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

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

◆ getColor()

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

Determines 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 149 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.getColor().

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

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

◆ getDarkness()

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

Determines 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 104 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.getDarkness().

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

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

◆ getFace()

Face com.realtime.crossfire.jxclient.map.CfMapPatch.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 161 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.getFace().

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

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

◆ getHeadMapSquare()

CfMapSquare com.realtime.crossfire.jxclient.map.CfMapPatch.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 189 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.getHeadMapSquare().

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

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

◆ getSmooth()

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

Determines 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 128 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.getSmooth().

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

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

◆ getSquare()

CfMapSquare com.realtime.crossfire.jxclient.map.CfMapPatch.getSquare ( final int  x,
final int  y 
)

Returns one map square.

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

Definition at line 220 of file CfMapPatch.java.

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

+ Here is the caller graph for this function:

◆ isFogOfWar()

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

Determines if a square is not up-to-date.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
Returns
whether the square is up-to-date

Definition at line 199 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.isFogOfWar().

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

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

◆ resetFogOfWar()

boolean com.realtime.crossfire.jxclient.map.CfMapPatch.resetFogOfWar ( final int  x,
final int  y 
)

Returns and reset the "fog-of-war" flag of a square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
Returns
whether this square's fog-of-war state has been reset

Definition at line 209 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.resetFogOfWar().

+ Here is the call graph for this function:

◆ setColor()

boolean com.realtime.crossfire.jxclient.map.CfMapPatch.setColor ( final int  x,
final int  y,
final int  color 
)

Sets the magic map color of one square.

Parameters
xthe x-coordinate of the square
ythe y-coordinate of the square
colorthe color to set
Returns
whether fog-of-war has been cleared

Definition at line 139 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.setColor().

+ Here is the call graph for this function:

◆ setDarkness()

boolean com.realtime.crossfire.jxclient.map.CfMapPatch.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
Returns
whether fog-of-war has been cleared

Definition at line 93 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.setDarkness().

+ Here is the call graph for this function:

◆ setHeadMapSquare()

void com.realtime.crossfire.jxclient.map.CfMapPatch.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.

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 176 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.setHeadMapSquare().

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

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

◆ setSmooth()

int com.realtime.crossfire.jxclient.map.CfMapPatch.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
Returns
whether fog-of-war has been cleared (1) or whether the smooth value has changed (2)

Definition at line 117 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.setSmooth().

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

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

Member Data Documentation

◆ SIZE

final int com.realtime.crossfire.jxclient.map.CfMapPatch.SIZE = 1<<SIZE_LOG
static

Size of patches in x- and y-direction.

Definition at line 42 of file CfMapPatch.java.

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

◆ SIZE_LOG

final int com.realtime.crossfire.jxclient.map.CfMapPatch.SIZE_LOG = 5
static

◆ square

final CfMapSquare [][] com.realtime.crossfire.jxclient.map.CfMapPatch.square = new CfMapSquare[SIZE][SIZE]
private

The array of CfMapSquares.

Elements are never

null

.

Definition at line 49 of file CfMapPatch.java.


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