1
0
Fork 0

Codechange: Use SQInteger for generic numbers in script_airport

pull/10532/head
glx22 2023-02-09 19:44:31 +01:00 committed by Loïc Guilloux
parent b6f3552e4b
commit 73561802cb
2 changed files with 12 additions and 12 deletions

View File

@ -49,21 +49,21 @@
return ::IsTileType(tile, MP_STATION) && ::IsAirport(tile); return ::IsTileType(tile, MP_STATION) && ::IsAirport(tile);
} }
/* static */ int32 ScriptAirport::GetAirportWidth(AirportType type) /* static */ SQInteger ScriptAirport::GetAirportWidth(AirportType type)
{ {
if (!IsAirportInformationAvailable(type)) return -1; if (!IsAirportInformationAvailable(type)) return -1;
return ::AirportSpec::Get(type)->size_x; return ::AirportSpec::Get(type)->size_x;
} }
/* static */ int32 ScriptAirport::GetAirportHeight(AirportType type) /* static */ SQInteger ScriptAirport::GetAirportHeight(AirportType type)
{ {
if (!IsAirportInformationAvailable(type)) return -1; if (!IsAirportInformationAvailable(type)) return -1;
return ::AirportSpec::Get(type)->size_y; return ::AirportSpec::Get(type)->size_y;
} }
/* static */ int32 ScriptAirport::GetAirportCoverageRadius(AirportType type) /* static */ SQInteger ScriptAirport::GetAirportCoverageRadius(AirportType type)
{ {
if (!IsAirportInformationAvailable(type)) return -1; if (!IsAirportInformationAvailable(type)) return -1;
@ -89,7 +89,7 @@
return ScriptObject::Command<CMD_LANDSCAPE_CLEAR>::Do(tile); return ScriptObject::Command<CMD_LANDSCAPE_CLEAR>::Do(tile);
} }
/* static */ int32 ScriptAirport::GetNumHangars(TileIndex tile) /* static */ SQInteger ScriptAirport::GetNumHangars(TileIndex tile)
{ {
if (!::IsValidTile(tile)) return -1; if (!::IsValidTile(tile)) return -1;
if (!::IsTileType(tile, MP_STATION)) return -1; if (!::IsTileType(tile, MP_STATION)) return -1;
@ -126,7 +126,7 @@
} }
/* static */ int ScriptAirport::GetNoiseLevelIncrease(TileIndex tile, AirportType type) /* static */ SQInteger ScriptAirport::GetNoiseLevelIncrease(TileIndex tile, AirportType type)
{ {
if (!::IsValidTile(tile)) return -1; if (!::IsValidTile(tile)) return -1;
if (!IsAirportInformationAvailable(type)) return -1; if (!IsAirportInformationAvailable(type)) return -1;
@ -156,7 +156,7 @@
return AirportGetNearestTown(as, AirportTileTableIterator(as->table[0], tile), dist)->index; return AirportGetNearestTown(as, AirportTileTableIterator(as->table[0], tile), dist)->index;
} }
/* static */ uint16 ScriptAirport::GetMaintenanceCostFactor(AirportType type) /* static */ SQInteger ScriptAirport::GetMaintenanceCostFactor(AirportType type)
{ {
if (!IsAirportInformationAvailable(type)) return 0; if (!IsAirportInformationAvailable(type)) return 0;

View File

@ -96,7 +96,7 @@ public:
* @pre IsAirportInformationAvailable(type). * @pre IsAirportInformationAvailable(type).
* @return The width in tiles. * @return The width in tiles.
*/ */
static int32 GetAirportWidth(AirportType type); static SQInteger GetAirportWidth(AirportType type);
/** /**
* Get the height of this type of airport. * Get the height of this type of airport.
@ -104,7 +104,7 @@ public:
* @pre IsAirportInformationAvailable(type). * @pre IsAirportInformationAvailable(type).
* @return The height in tiles. * @return The height in tiles.
*/ */
static int32 GetAirportHeight(AirportType type); static SQInteger GetAirportHeight(AirportType type);
/** /**
* Get the coverage radius of this type of airport. * Get the coverage radius of this type of airport.
@ -112,7 +112,7 @@ public:
* @pre IsAirportInformationAvailable(type). * @pre IsAirportInformationAvailable(type).
* @return The radius in tiles. * @return The radius in tiles.
*/ */
static int32 GetAirportCoverageRadius(AirportType type); static SQInteger GetAirportCoverageRadius(AirportType type);
/** /**
* Get the number of hangars of the airport. * Get the number of hangars of the airport.
@ -120,7 +120,7 @@ public:
* @pre ScriptMap::IsValidTile(tile). * @pre ScriptMap::IsValidTile(tile).
* @return The number of hangars of the airport. * @return The number of hangars of the airport.
*/ */
static int32 GetNumHangars(TileIndex tile); static SQInteger GetNumHangars(TileIndex tile);
/** /**
* Get the first hangar tile of the airport. * Get the first hangar tile of the airport.
@ -180,7 +180,7 @@ public:
* @return The amount of noise added to the nearest town. * @return The amount of noise added to the nearest town.
* @note The noise will be added to the town with TownID GetNearestTown(tile, type). * @note The noise will be added to the town with TownID GetNearestTown(tile, type).
*/ */
static int GetNoiseLevelIncrease(TileIndex tile, AirportType type); static SQInteger GetNoiseLevelIncrease(TileIndex tile, AirportType type);
/** /**
* Get the TownID of the town whose local authority will influence * Get the TownID of the town whose local authority will influence
@ -198,7 +198,7 @@ public:
* @pre IsAirportInformationAvailable(type) * @pre IsAirportInformationAvailable(type)
* @return Maintenance cost factor of the airport type. * @return Maintenance cost factor of the airport type.
*/ */
static uint16 GetMaintenanceCostFactor(AirportType type); static SQInteger GetMaintenanceCostFactor(AirportType type);
/** /**
* Get the monthly maintenance cost of an airport type. * Get the monthly maintenance cost of an airport type.