diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-11-01 21:30:34 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 6691ee3b963ee3282490360bb3cc1ea09d0c58ea (patch) | |
tree | 398b1139844d2566831e249836b6923bd88b6124 /src/script/api/script_marine.cpp | |
parent | eab18f06a47e558fe313cb86c855e8949b01feed (diff) | |
download | openttd-6691ee3b963ee3282490360bb3cc1ea09d0c58ea.tar.xz |
Codechange: Template script command calls.
Diffstat (limited to 'src/script/api/script_marine.cpp')
-rw-r--r-- | src/script/api/script_marine.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/script/api/script_marine.cpp b/src/script/api/script_marine.cpp index 16f0228db..f368ec918 100644 --- a/src/script/api/script_marine.cpp +++ b/src/script/api/script_marine.cpp @@ -11,7 +11,12 @@ #include "script_marine.hpp" #include "script_station.hpp" #include "../../station_base.h" +#include "../../dock_cmd.h" +#include "../../landscape_cmd.h" +#include "../../station_cmd.h" #include "../../tile_cmd.h" +#include "../../water_cmd.h" +#include "../../waypoint_cmd.h" #include "../../safeguards.h" @@ -78,7 +83,7 @@ EnforcePrecondition(false, ::IsValidTile(front)); EnforcePrecondition(false, (::TileX(front) == ::TileX(tile)) != (::TileY(front) == ::TileY(tile))); - return ScriptObject::DoCommand(tile, ::TileX(front) == ::TileX(tile), 0, CMD_BUILD_SHIP_DEPOT); + return ScriptObject::Command<CMD_BUILD_SHIP_DEPOT>::Do(tile, ::TileX(front) == ::TileX(tile), 0, {}); } /* static */ bool ScriptMarine::BuildDock(TileIndex tile, StationID station_id) @@ -89,7 +94,7 @@ uint p1 = station_id == ScriptStation::STATION_JOIN_ADJACENT ? 0 : 1; uint p2 = (ScriptStation::IsValidStation(station_id) ? station_id : INVALID_STATION) << 16; - return ScriptObject::DoCommand(tile, p1, p2, CMD_BUILD_DOCK); + return ScriptObject::Command<CMD_BUILD_DOCK>::Do(tile, p1, p2, {}); } /* static */ bool ScriptMarine::BuildBuoy(TileIndex tile) @@ -97,7 +102,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_BUILD_BUOY); + return ScriptObject::Command<CMD_BUILD_BUOY>::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::BuildLock(TileIndex tile) @@ -105,7 +110,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_BUILD_LOCK); + return ScriptObject::Command<CMD_BUILD_LOCK>::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::BuildCanal(TileIndex tile) @@ -113,7 +118,7 @@ EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY); EnforcePrecondition(false, ::IsValidTile(tile)); - return ScriptObject::DoCommand(tile, tile, WATER_CLASS_CANAL, CMD_BUILD_CANAL); + return ScriptObject::Command<CMD_BUILD_CANAL>::Do(tile, tile, WATER_CLASS_CANAL, {}); } /* static */ bool ScriptMarine::RemoveWaterDepot(TileIndex tile) @@ -122,7 +127,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsWaterDepotTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command<CMD_LANDSCAPE_CLEAR>::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveDock(TileIndex tile) @@ -131,7 +136,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsDockTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command<CMD_LANDSCAPE_CLEAR>::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveBuoy(TileIndex tile) @@ -140,7 +145,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsBuoyTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command<CMD_LANDSCAPE_CLEAR>::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveLock(TileIndex tile) @@ -149,7 +154,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsLockTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command<CMD_LANDSCAPE_CLEAR>::Do(tile, 0, 0, {}); } /* static */ bool ScriptMarine::RemoveCanal(TileIndex tile) @@ -158,7 +163,7 @@ EnforcePrecondition(false, ::IsValidTile(tile)); EnforcePrecondition(false, IsCanalTile(tile)); - return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR); + return ScriptObject::Command<CMD_LANDSCAPE_CLEAR>::Do(tile, 0, 0, {}); } /* static */ Money ScriptMarine::GetBuildCost(BuildType build_type) |