(svn r4250) -Codechange: Further use of map accessors for water tiles

This commit is contained in:
celestar
2006-04-03 10:28:16 +00:00
parent cc87f682b9
commit 7d3827cf35
2 changed files with 22 additions and 31 deletions

View File

@@ -38,6 +38,11 @@ static inline bool IsWater(TileIndex t)
return GetWaterTileType(t) == WATER_CLEAR;
}
static inline bool IsCoast(TileIndex t)
{
return GetWaterTileType(t) == WATER_COAST;
}
static inline bool IsClearWaterTile(TileIndex t)
{
return IsTileType(t, MP_WATER) && IsWater(t) && GetTileSlope(t, NULL) == 0;
@@ -53,6 +58,11 @@ static inline TileIndex IsShipDepot(TileIndex t)
return IS_INT_INSIDE(_m[t].m5, DEPOT_NORTH, DEPOT_END);
}
static inline Axis GetShipDepotAxis(TileIndex t)
{
return (Axis)GB(_m[t].m5, 1, 1);
}
static inline DiagDirection GetLockDirection(TileIndex t)
{
return (DiagDirection)GB(_m[t].m5, 0, 2);