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

Public Member Functions

 CfMapPatch (@NotNull final CfMap map, final int x0, final int y0)
 
void clearSquare (final int x, final int y)
 
void dirty (final int x, final int y)
 
int getColor (final int x, final int y)
 
int getDarkness (final int x, final int y)
 
Face getFace (final int x, final int y, final int layer)
 
CfMapSquare getHeadMapSquare (final int x, final int y, final int layer)
 
int getSmooth (final int x, final int y, final int layer)
 
CfMapSquare getSquare (final int x, final int y)
 
boolean isFogOfWar (final int x, final int y)
 
boolean resetFogOfWar (final int x, final int y)
 
void setColor (final int x, final int y, final int color)
 
boolean setDarkness (final int x, final int y, final int darkness)
 
void setHeadMapSquare (final int x, final int y, final int layer, @Nullable final CfMapSquare mapSquare, final boolean setAlways)
 
int setSmooth (final int x, final int y, final int layer, final int smooth)
 

Static Public Attributes

static final int SIZE = 1<<SIZE_LOG
 
static final int SIZE_LOG = 5
 

Private Attributes

final CfMapSquare[][] square = new CfMapSquare[SIZE][SIZE]
 

Detailed Description

Represents a square area of CfMapSquares.

Author
Andreas Kirschbaum

Definition at line 33 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 60 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapPatch.SIZE, and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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

References com.realtime.crossfire.jxclient.map.CfMapSquare.clear(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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

References com.realtime.crossfire.jxclient.map.CfMapSquare.dirty(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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

References com.realtime.crossfire.jxclient.map.CfMapSquare.getDarkness(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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

References com.realtime.crossfire.jxclient.map.CfMapSquare.getSmooth(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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.

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

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(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

Here is the call graph for this function:

◆ setColor()

void 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

Definition at line 139 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.setColor(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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

Here is the call graph for this function:
Here is the caller 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 94 of file CfMapPatch.java.

References com.realtime.crossfire.jxclient.map.CfMapSquare.setDarkness(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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

References com.realtime.crossfire.jxclient.map.CfMapSquare.setSmooth(), and com.realtime.crossfire.jxclient.map.CfMapPatch.square.

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 43 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 documentation for this class was generated from the following file: