Codechange: use GSCompanyMode::IsValid, IsDeity, and the precondition helpers

Direct 1:1 replacements in the code, and comments now refer to either
GSCompanyMode::IsValid or GSCompanyMode::IsDeity instead of several variations
on "company mode active" or "no company mode active".
This commit is contained in:
Rubidium
2023-03-02 19:44:13 +01:00
committed by rubidium42
parent cada2ca310
commit 83946ca31d
46 changed files with 227 additions and 226 deletions

View File

@@ -99,7 +99,7 @@ public:
* @param front A tile on the same axis with 'tile' as the depot shall be oriented.
* @pre ScriptMap::IsValidTile(tile).
* @pre ScriptMap::IsValidTile(front).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @exception ScriptMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER
@@ -115,7 +115,7 @@ public:
* @param station_id The station to join, ScriptStation::STATION_NEW or ScriptStation::STATION_JOIN_ADJACENT.
* @pre ScriptMap::IsValidTile(tile).
* @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @exception ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
@@ -128,7 +128,7 @@ public:
* Builds a buoy on tile.
* @param tile The tile where the buoy will be build.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
@@ -140,7 +140,7 @@ public:
* Builds a lock on tile.
* @param tile The tile where the lock will be build.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptError::ERR_SITE_UNSUITABLE
* @return Whether the lock has been/can be build or not.
@@ -151,7 +151,7 @@ public:
* Builds a canal on tile.
* @param tile The tile where the canal will be build.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
@@ -164,7 +164,7 @@ public:
* Removes a water depot.
* @param tile Any tile of the water depot.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the water depot has been/can be removed or not.
*/
@@ -174,7 +174,7 @@ public:
* Removes a dock.
* @param tile Any tile of the dock.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the dock has been/can be removed or not.
*/
@@ -184,7 +184,7 @@ public:
* Removes a buoy.
* @param tile Any tile of the buoy.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the buoy has been/can be removed or not.
*/
@@ -194,7 +194,7 @@ public:
* Removes a lock.
* @param tile Any tile of the lock.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the lock has been/can be removed or not.
*/
@@ -204,7 +204,7 @@ public:
* Removes a canal.
* @param tile Any tile of the canal.
* @pre ScriptMap::IsValidTile(tile).
* @game @pre Valid ScriptCompanyMode active in scope.
* @game @pre ScriptCompanyMode::IsValid().
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the canal has been/can be removed or not.
*/