 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.map;
27 import org.jetbrains.annotations.NotNull;
28 import org.jetbrains.annotations.Nullable;
171 for (layer = 0; layer <
faces.length; layer++) {
177 if (layer >=
faces.length) {
218 public int setSmooth(
final int layer,
final int smooth) {
219 final boolean fogOfWarCleared =
fogOfWar;
220 final boolean smoothChanged =
smooths[layer] != smooth;
222 final boolean markDirty =
fogOfWar || smoothChanged;
227 return (fogOfWarCleared ? 1 : 0)|(smoothChanged ? 2 : 0);
244 final boolean markDirty = this.color !=
color;
266 if (
faces[layer] != face) {
295 heads[layer] = mapSquare;
void dirty()
Marks this square as dirty, i.e., needing redraw.
boolean fogOfWar
Flag used to defer clearing the values: when a.
int darkness
The darkness value of the square in the range [0..255].
final CfMap map
The CfMap this map square is part of.
final int[] smooths
The smooth values of all layers as sent by the server.
Represents a map (as seen by the client).
CfMapSquare getHeadMapSquare(final int layer)
Returns the map square of the head of a multi-square object.
static final int DARKNESS_FULL_BRIGHT
The darkness value for a full bright square.
static final int DEFAULT_SMOOTH
The default smooth value for newly created squares.
Manages image information ("faces") needed to display the map view, items, and spell icons.
CfMapSquare(@NotNull final CfMap map, final int x, final int y)
Creates a new (empty) square.
void setFace(final int layer, @Nullable final Face face)
Sets the face of a layer.
void clear()
Marks this square as 'fog-og-war'.
int setSmooth(final int layer, final int smooth)
Sets the smooth value of this square.
int color
The magic map color of the square.
int getColor()
Returns the magic map color of this square.
boolean setDarkness(final int darkness)
Sets the darkness value of this square.
void setColor(final int color)
Sets the magic map color of this square.
Interface defining constants for the "map2" Crossfire protocol message.
final int y
The absolute y-coordinate of this square in its CfMap.
Face getFace(final int layer)
Returns the face of a layer.
static final Face DEFAULT_FACE
The default face value for newly creates squares.
static final int DEFAULT_COLOR
The default magic map color for newly created squares.
int getDarkness()
Returns the darkness value of this square.
int getSmooth(final int layer)
Returns the smooth value of this square.
int getY()
Returns the absolute map y-coordinate of this square.
boolean resetFogOfWar()
Returns and resets the "fog-of-war" flag.
int getX()
Returns the absolute map x-coordinate of this square.
final CfMapSquare[] heads
If this square contains a non-head part of a multi-square object this points to the head square.
static final int DEFAULT_DARKNESS
The default darkness value for newly created squares.
int NUM_LAYERS
The total number of map layers to display.
final Face[] faces
The faces (of head-parts) of all layers as sent by the server.
Represents a square in a CfMap.
void squareModified(@NotNull final CfMapSquare mapSquare)
Marks a CfMapSquare as dirty.
void setHeadMapSquare(final int layer, @Nullable final CfMapSquare mapSquare, final boolean setAlways)
Sets the map square containing the head face for a layer.
boolean isFogOfWar()
Determines if the square is not up-to-date.
final int x
The absolute x-coordinate of this square in its CfMap.