public class Tile extends GameObject
Modifier and Type | Field and Description |
---|---|
int |
corpses
The amount of corpses on this tile.
|
boolean |
isCastle
Whether or not the tile is a castle tile.
|
boolean |
isGoldMine
Whether or not the tile is considered to be a gold mine or not.
|
boolean |
isGrass
Whether or not the tile is considered grass or not (Workers can walk on grass).
|
boolean |
isIslandGoldMine
Whether or not the tile is considered to be the island gold mine or not.
|
boolean |
isPath
Whether or not the tile is considered a path or not (Units can walk on paths).
|
boolean |
isRiver
Whether or not the tile is considered a river or not.
|
boolean |
isTower
Whether or not the tile is considered a tower or not.
|
boolean |
isUnitSpawn
Whether or not the tile is the unit spawn.
|
boolean |
isWall
Whether or not the tile can be moved on by workers.
|
boolean |
isWorkerSpawn
Whether or not the tile is the worker spawn.
|
int |
numGhouls
The amount of Ghouls on this tile.
|
int |
numHounds
The amount of Hounds on this tile.
|
int |
numZombies
The amount of Zombies on this tile.
|
Player |
owner
Which player owns this tile, only applies to grass tiles for workers, NULL otherwise.
|
Tile |
tileEast
The Tile to the 'East' of this one (x+1, y).
|
Tile |
tileNorth
The Tile to the 'North' of this one (x, y-1).
|
Tile |
tileSouth
The Tile to the 'South' of this one (x, y+1).
|
Tile |
tileWest
The Tile to the 'West' of this one (x-1, y).
|
Tower |
tower
The Tower on this Tile if present, otherwise null.
|
Unit |
unit
The Unit on this Tile if present, otherwise null.
|
int |
x
The x (horizontal) position of this Tile.
|
int |
y
The y (vertical) position of this Tile.
|
logs
Modifier and Type | Method and Description |
---|---|
java.util.List<Tile> |
getNeighbors()
Gets the neighbors of this Tile
|
boolean |
hasNeighbor(Tile tile)
Checks if this Tile has a specific neighboring Tile
|
boolean |
isPathable()
Checks if a Tile is pathable to units
|
boolean |
res(int num)
Resurrect the corpses on this tile into Zombies.
|
boolean |
spawnUnit(java.lang.String title)
Spawns a fighting unit on the correct tile.
|
boolean |
spawnWorker()
Spawns a worker on the correct tile.
|
log
public int corpses
public boolean isCastle
public boolean isGoldMine
public boolean isGrass
public boolean isIslandGoldMine
public boolean isPath
public boolean isRiver
public boolean isTower
public boolean isUnitSpawn
public boolean isWall
public boolean isWorkerSpawn
public int numGhouls
public int numHounds
public int numZombies
public Player owner
public Tile tileEast
public Tile tileNorth
public Tile tileSouth
public Tile tileWest
public Tower tower
public Unit unit
public int x
public int y
public boolean res(int num)
num
- Number of zombies to resurrect.public boolean spawnUnit(java.lang.String title)
title
- The title of the desired unit type.public boolean spawnWorker()
public java.util.List<Tile> getNeighbors()
public boolean isPathable()
public boolean hasNeighbor(Tile tile)
tile
- Tile to check against© 2020 MST ACM SIG-GAME