cleanup: move autobulldoze-testing functions to TileConstants
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@619 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
36f056087e
commit
7d2b2fdda5
2 changed files with 34 additions and 34 deletions
|
@ -331,40 +331,6 @@ public enum MicropolisTool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether the tile can be auto-bulldozed for
|
|
||||||
* placement of road, rail, or wire.
|
|
||||||
*/
|
|
||||||
static boolean canAutoBulldozeRRW(int tileValue)
|
|
||||||
{
|
|
||||||
// can we autobulldoze this tile?
|
|
||||||
return (
|
|
||||||
(tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) ||
|
|
||||||
(tileValue >= TINYEXP && tileValue <= LASTTINYEXP)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks whether the tile can be auto-bulldozed for
|
|
||||||
* placement of a zone.
|
|
||||||
*/
|
|
||||||
static boolean canAutoBulldozeZ(char tileValue)
|
|
||||||
{
|
|
||||||
//FIXME- what is significance of POWERBASE+2 and POWERBASE+12 ?
|
|
||||||
|
|
||||||
// can we autobulldoze this tile?
|
|
||||||
if ((tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) ||
|
|
||||||
(tileValue >= POWERBASE + 2 && tileValue <= POWERBASE + 12) ||
|
|
||||||
(tileValue >= TINYEXP && tileValue <= LASTTINYEXP))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void fixBorder(Micropolis engine, int left, int top, int right, int bottom)
|
void fixBorder(Micropolis engine, int left, int top, int right, int bottom)
|
||||||
{
|
{
|
||||||
for (int x = left; x <= right; x++)
|
for (int x = left; x <= right; x++)
|
||||||
|
|
|
@ -233,6 +233,40 @@ public class TileConstants
|
||||||
FOOTBALLGAME1, VBRDG0, URANIUM_FUEL, LAST_TILE
|
FOOTBALLGAME1, VBRDG0, URANIUM_FUEL, LAST_TILE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the tile can be auto-bulldozed for
|
||||||
|
* placement of road, rail, or wire.
|
||||||
|
*/
|
||||||
|
public static boolean canAutoBulldozeRRW(int tileValue)
|
||||||
|
{
|
||||||
|
// can we autobulldoze this tile?
|
||||||
|
return (
|
||||||
|
(tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) ||
|
||||||
|
(tileValue >= TINYEXP && tileValue <= LASTTINYEXP)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the tile can be auto-bulldozed for
|
||||||
|
* placement of a zone.
|
||||||
|
*/
|
||||||
|
public static boolean canAutoBulldozeZ(char tileValue)
|
||||||
|
{
|
||||||
|
//FIXME- what is significance of POWERBASE+2 and POWERBASE+12 ?
|
||||||
|
|
||||||
|
// can we autobulldoze this tile?
|
||||||
|
if ((tileValue >= FIRSTRIVEDGE && tileValue <= LASTRUBBLE) ||
|
||||||
|
(tileValue >= POWERBASE + 2 && tileValue <= POWERBASE + 12) ||
|
||||||
|
(tileValue >= TINYEXP && tileValue <= LASTTINYEXP))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//used by queryZoneStatus
|
//used by queryZoneStatus
|
||||||
public static int getBuildingId(int tile)
|
public static int getBuildingId(int tile)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue