java.lang.Objectcom.realtime.crossfire.jxclient.map.CfMapPatch
public class CfMapPatch
Represents a square area of CfMapSquares.
| Field Summary | |
|---|---|
static int | 
SIZE
Size of patches in x- and y-direction.  | 
static int | 
SIZE_LOG
Log2 of SIZE. | 
private  CfMapSquare[][] | 
square
The array of CfMapSquares. | 
| Constructor Summary | |
|---|---|
CfMapPatch(CfMap map,
           int x0,
           int y0)
Creates a new (empty) patch.  | 
|
| Method Summary | |
|---|---|
 void | 
clearSquare(int x,
            int y)
Clears the content of one square.  | 
 void | 
dirty(int x,
      int y)
Marks a square as dirty.  | 
 int | 
getColor(int x,
         int y)
Determines the magic map color value of one square.  | 
 int | 
getDarkness(int x,
            int y)
Determines the darkness value of one square.  | 
 Face | 
getFace(int x,
        int y,
        int layer)
Determines the face of one square.  | 
 CfMapSquare | 
getHeadMapSquare(int x,
                 int y,
                 int layer)
Returns the map square of the head of a multi-square object.  | 
 CfMapSquare | 
getSquare(int x,
          int y)
Returns one map square.  | 
 boolean | 
isFogOfWar(int x,
           int y)
Determines if a square is not up-to-date.  | 
 boolean | 
resetFogOfWar(int x,
              int y)
Returns and reset the "fog-of-war" flag of a square.  | 
 boolean | 
setColor(int x,
         int y,
         int color)
Sets the magic map color of one square.  | 
 boolean | 
setDarkness(int x,
            int y,
            int darkness)
Sets the darkness value of one square.  | 
 void | 
setHeadMapSquare(int x,
                 int y,
                 int layer,
                 CfMapSquare mapSquare,
                 boolean setAlways)
Sets the map square containing the head face for a layer.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int SIZE
public static final int SIZE_LOG
SIZE.
@NotNull private final CfMapSquare[][] square
CfMapSquares. Elements are never null.
| Constructor Detail | 
|---|
public CfMapPatch(@NotNull
                  CfMap map,
                  int x0,
                  int y0)
map - the map this map patch is part ofx0 - the absolute map x-coordinate of the top left corner of this
 patchy0 - the absolute map y-coordinate of the top left corner of this
 patch| Method Detail | 
|---|
public void clearSquare(int x,
                        int y)
x - the x-coordinate of the squarey - the y-coordinate of the square
public void dirty(int x,
                  int y)
x - the x-coordinate of the squarey - the y-coordinate of the square
public int getColor(int x,
                    int y)
x - the x-coordinate of the squarey - the y-coordinate of the square
public int getDarkness(int x,
                       int y)
x - the x-coordinate of the squarey - the y-coordinate of the square
@Nullable
public Face getFace(int x,
                             int y,
                             int layer)
x - the x-coordinate of the squarey - the y-coordinate of the squarelayer - the layer of the face
null
@Nullable
public CfMapSquare getHeadMapSquare(int x,
                                             int y,
                                             int layer)
x - the x-coordinate of the squarey - the y-coordinate of the squarelayer - the layer to return the head for
null if this square does not
         contain a multi-tail
@NotNull
public CfMapSquare getSquare(int x,
                                     int y)
x - the x-coordinate of the squarey - the y-coordinate of the square
public boolean isFogOfWar(int x,
                          int y)
x - the x-coordinate of the squarey - the y-coordinate of the square
public boolean resetFogOfWar(int x,
                             int y)
x - the x-coordinate of the squarey - the y-coordinate of the square
public boolean setColor(int x,
                        int y,
                        int color)
x - the x-coordinate of the squarey - the y-coordinate of the squarecolor - the color to set
public boolean setDarkness(int x,
                           int y,
                           int darkness)
x - the x-coordinate of the squarey - the y-coordinate of the squaredarkness - the darkness value to set; 0=dark, 255=full bright
public void setHeadMapSquare(int x,
                             int y,
                             int layer,
                             @Nullable
                             CfMapSquare mapSquare,
                             boolean setAlways)
x - the x-coordinate of the squarey - the y-coordinate of the squarelayer - the layer for the new head face between 0 and
 LAYERS-1mapSquare - the map square containing the head face; may be
 nullsetAlways - if set, always update the face; if unset, only update
 when fog-of-war