tiles: helper functions- isFire, isRadioactive, isFlood
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@679 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
d708cdb0f2
commit
6794888026
2 changed files with 39 additions and 24 deletions
|
@ -297,6 +297,18 @@ public class TileConstants
|
|||
&& ((tile & BURNBIT) == 0));
|
||||
}
|
||||
|
||||
public static boolean isFire(int tile)
|
||||
{
|
||||
int tmp = tile & LOMASK;
|
||||
return (tmp >= FIREBASE && tmp < ROADBASE);
|
||||
}
|
||||
|
||||
public static boolean isRadioactive(int tile)
|
||||
{
|
||||
int tmp = tile & LOMASK;
|
||||
return (tmp >= RADTILE && tmp < FIREBASE);
|
||||
}
|
||||
|
||||
public static boolean isOverWater(char cell)
|
||||
{
|
||||
switch (cell & LOMASK)
|
||||
|
@ -384,6 +396,12 @@ public class TileConstants
|
|||
return tile >= 0 && (tile & BULLBIT) != 0;
|
||||
}
|
||||
|
||||
public static boolean isFlood(int tile)
|
||||
{
|
||||
int tmp = tile & LOMASK;
|
||||
return (tmp >= FLOOD && tmp < RADTILE);
|
||||
}
|
||||
|
||||
static boolean isFloodable(int tile)
|
||||
{
|
||||
return (tile == DIRT || ((tile & BULLBIT) != 0 && (tile & BURNBIT) != 0));
|
||||
|
|
Reference in a new issue