Codechange: Use enum class for water-related enums. (#14804)
This commit is contained in:
@@ -2702,7 +2702,7 @@ CommandCost CmdBuildAirport(DoCommandFlags flags, TileIndex tile, uint8_t airpor
|
||||
|
||||
for (AirportTileTableIterator iter(as->layouts[layout].tiles, tile); iter != INVALID_TILE; ++iter) {
|
||||
Tile t(iter);
|
||||
MakeAirport(t, st->owner, st->index, iter.GetStationGfx(), WATER_CLASS_INVALID);
|
||||
MakeAirport(t, st->owner, st->index, iter.GetStationGfx(), WaterClass::Invalid);
|
||||
SetStationTileRandomBits(t, GB(Random(), 0, 4));
|
||||
st->airport.Add(iter);
|
||||
|
||||
@@ -2946,7 +2946,7 @@ CommandCost CmdBuildDock(DoCommandFlags flags, TileIndex tile, StationID station
|
||||
* This is needed as we've cleared that tile before.
|
||||
* Clearing object tiles may result in water tiles which are already accounted for in the water infrastructure total.
|
||||
* See: MakeWaterKeepingClass() */
|
||||
if (wc == WATER_CLASS_CANAL && !(HasTileWaterClass(flat_tile) && GetWaterClass(flat_tile) == WATER_CLASS_CANAL && IsTileOwner(flat_tile, _current_company))) {
|
||||
if (wc == WaterClass::Canal && !(HasTileWaterClass(flat_tile) && GetWaterClass(flat_tile) == WaterClass::Canal && IsTileOwner(flat_tile, _current_company))) {
|
||||
Company::Get(st->owner)->infrastructure.water++;
|
||||
}
|
||||
Company::Get(st->owner)->infrastructure.station += 2;
|
||||
@@ -3357,8 +3357,8 @@ static void DrawTile_Station(TileInfo *ti)
|
||||
} else {
|
||||
assert(IsDock(ti->tile));
|
||||
TileIndex water_tile = ti->tile + TileOffsByDiagDir(GetDockDirection(ti->tile));
|
||||
WaterClass wc = HasTileWaterClass(water_tile) ? GetWaterClass(water_tile) : WATER_CLASS_INVALID;
|
||||
if (wc == WATER_CLASS_SEA) {
|
||||
WaterClass wc = HasTileWaterClass(water_tile) ? GetWaterClass(water_tile) : WaterClass::Invalid;
|
||||
if (wc == WaterClass::Sea) {
|
||||
DrawShoreTile(ti->tileh);
|
||||
} else {
|
||||
DrawClearLandTile(ti, 3);
|
||||
@@ -4748,7 +4748,7 @@ static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_o
|
||||
|
||||
case StationType::Buoy:
|
||||
case StationType::Dock:
|
||||
if (GetWaterClass(tile) == WATER_CLASS_CANAL) {
|
||||
if (GetWaterClass(tile) == WaterClass::Canal) {
|
||||
old_company->infrastructure.water--;
|
||||
new_company->infrastructure.water++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user