-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ilk.java
41 lines (34 loc) · 933 Bytes
/
Ilk.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Represents type of tile on the game map.
*/
public enum Ilk {
/** Water tile. */
WATER,
/** Food tile. */
FOOD,
/** Land tile. */
LAND,
/** Dead ant tile. */
DEAD,
/** My ant tile. */
MY_ANT,
/** Enemy ant tile. */
ENEMY_ANT;
/**
* Checks if this type of tile is passable, which means it is not a water tile.
*
* @return <code>true</code> if this is not a water tile, <code>false</code> otherwise
*/
public boolean isPassable() {
return ordinal() > WATER.ordinal();
}
/**
* Checks if this type of tile is unoccupied, which means it is a land tile or a dead ant tile.
*
* @return <code>true</code> if this is a land tile or a dead ant tile, <code>false</code>
* otherwise
*/
public boolean isUnoccupied() {
return this == LAND || this == DEAD;
}
}