public class FieldMap<T extends AStarNodeBase<T>> extends AStarMapBase<T>
Modifier and Type | Field and Description |
---|---|
protected boolean[] |
blockages |
protected java.util.Vector<T> |
nodes |
protected int |
wx |
protected int |
wy |
protected int |
wz |
objectPool
Modifier | Constructor and Description |
---|---|
protected |
FieldMap(FieldMap<T> clone) |
|
FieldMap(int wx,
int wy,
int wz,
int ox,
int oy,
int oz) |
Modifier and Type | Method and Description |
---|---|
void |
clearMapKeepBlocks() |
AStarMapBase<T> |
clone() |
int |
getMaxXNodes()
Returns the horizontal size of the map.
|
int |
getMaxYNodes()
Returns the vertical size of the map.
|
int |
getMaxZNodes()
Returns the number of layers of the map.
|
T |
getNode(int x,
int y,
int z) |
boolean |
inRange(int x,
int y,
int z) |
boolean |
isTileBlocked(int x,
int y,
int z)
Returns if the specified position is blocked.
|
T |
nodeAt(int x,
int y,
int z)
Returns the node at the given coordinates.
|
void |
setNode(int x,
int y,
int z,
T node) |
void |
setTileBlocked(int x,
int y,
int z,
boolean blockedStatus)
Marks the specified position as blocked, which means that there is no valid
movement from any adjacent tile to this one.
|
void |
visitNeighboursOf(T origin,
AStarMapVisitorBase<T> visitor)
Lets the provided visitor visit all non-blocked neighbours of a given node.
|
setObjectPool, tryInsertPath, visitIfNotBlocked, visitNeighboursOf4, visitNeighboursOf8
protected int wx
protected int wy
protected int wz
protected boolean[] blockages
protected java.util.Vector<T extends AStarNodeBase<T>> nodes
public void visitNeighboursOf(T origin, AStarMapVisitorBase<T> visitor)
AStarMapBase
visitNeighboursOf
in class AStarMapBase<T extends AStarNodeBase<T>>
origin
- Node whose neighbours shall be visited.visitor
- Visitor to use.public boolean inRange(int x, int y, int z)
public boolean isTileBlocked(int x, int y, int z)
AStarMapBase
isTileBlocked
in class AStarMapBase<T extends AStarNodeBase<T>>
x
- Horizontal positiony
- Vertical positionz
- Layertrue
if this position is blocked, false
otherwise.public void setTileBlocked(int x, int y, int z, boolean blockedStatus)
AStarMapBase
setTileBlocked
in class AStarMapBase<T extends AStarNodeBase<T>>
x
- Horizontal positiony
- Vertical positionblockedStatus
- true
if this position should be blocked,
false
otherwise.public T nodeAt(int x, int y, int z)
AStarMapBase
null
in these cases.nodeAt
in class AStarMapBase<T extends AStarNodeBase<T>>
x
- Horizontal positiony
- Vertical positionnull
if none exists
there.public T getNode(int x, int y, int z)
public void setNode(int x, int y, int z, T node)
public void clearMapKeepBlocks()
clearMapKeepBlocks
in class AStarMapBase<T extends AStarNodeBase<T>>
public AStarMapBase<T> clone()
clone
in class AStarMapBase<T extends AStarNodeBase<T>>
public int getMaxXNodes()
AStarMapBase
0
.getMaxXNodes
in class AStarMapBase<T extends AStarNodeBase<T>>
public int getMaxYNodes()
AStarMapBase
0
.getMaxYNodes
in class AStarMapBase<T extends AStarNodeBase<T>>
public int getMaxZNodes()
AStarMapBase
0
.getMaxZNodes
in class AStarMapBase<T extends AStarNodeBase<T>>