Index: src/ai/api/ai_marine.cpp =================================================================== --- src/ai/api/ai_marine.cpp (revision 12187) +++ src/ai/api/ai_marine.cpp (working copy) @@ -47,47 +47,47 @@ return ::IsTileType(tile, MP_WATER) && ::IsCanal(tile); } -bool AIMarine::BuildWaterDepot(TileIndex tile, bool vertical) +/* static */ bool AIMarine::BuildWaterDepot(TileIndex tile, bool vertical) { /* Outside of the map */ if (tile >= ::MapSize()) return false; - return this->DoCommand(tile, vertical, 0, CMD_BUILD_SHIP_DEPOT, false); + return DoCommand(tile, vertical, 0, CMD_BUILD_SHIP_DEPOT, false); } -bool AIMarine::BuildDock(TileIndex tile) +/* static */ bool AIMarine::BuildDock(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; - return this->DoCommand(tile, 1, 0, CMD_BUILD_DOCK, false); + return DoCommand(tile, 1, 0, CMD_BUILD_DOCK, false); } -bool AIMarine::BuildBuoy(TileIndex tile) +/* static */ bool AIMarine::BuildBuoy(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; - return this->DoCommand(tile, 0, 0, CMD_BUILD_BUOY, false); + return DoCommand(tile, 0, 0, CMD_BUILD_BUOY, false); } -bool AIMarine::BuildLock(TileIndex tile) +/* static */ bool AIMarine::BuildLock(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; - return this->DoCommand(tile, 0, 0, CMD_BUILD_LOCK, false); + return DoCommand(tile, 0, 0, CMD_BUILD_LOCK, false); } -bool AIMarine::BuildCanal(TileIndex tile) +/* static */ bool AIMarine::BuildCanal(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; - return this->DoCommand(tile, tile, 0, CMD_BUILD_CANAL, false); + return DoCommand(tile, tile, 0, CMD_BUILD_CANAL, false); } -bool AIMarine::RemoveWaterDepot(TileIndex tile) +/* static */ bool AIMarine::RemoveWaterDepot(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; @@ -95,10 +95,10 @@ /* Not a water depot tile */ if (!IsWaterDepotTile(tile)) return false; - return this->DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); + return DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); } -bool AIMarine::RemoveDock(TileIndex tile) +/* static */ bool AIMarine::RemoveDock(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; @@ -106,10 +106,10 @@ /* Not a dock tile */ if (!IsDockTile(tile)) return false; - return this->DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); + return DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); } -bool AIMarine::RemoveBuoy(TileIndex tile) +/* static */ bool AIMarine::RemoveBuoy(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; @@ -117,10 +117,10 @@ /* Not a buoy tile */ if (!IsBuoyTile(tile)) return false; - return this->DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); + return DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); } -bool AIMarine::RemoveLock(TileIndex tile) +/* static */ bool AIMarine::RemoveLock(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; @@ -128,10 +128,10 @@ /* Not a lock tile */ if (!IsLockTile(tile)) return false; - return this->DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); + return DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); } -bool AIMarine::RemoveCanal(TileIndex tile) +/* static */ bool AIMarine::RemoveCanal(TileIndex tile) { /* Outside of the map */ if (tile >= ::MapSize()) return false; @@ -139,5 +139,5 @@ /* Not a canal tile */ if (!IsCanalTile(tile)) return false; - return this->DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); + return DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR, false); } Index: src/ai/api/ai_marine.hpp =================================================================== --- src/ai/api/ai_marine.hpp (revision 12187) +++ src/ai/api/ai_marine.hpp (working copy) @@ -64,7 +64,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the water depot has been/can be build or not. */ - bool BuildWaterDepot(TileIndex tile, bool vertical); + static bool BuildWaterDepot(TileIndex tile, bool vertical); /** * Builds a dock where tile is the tile still on land. @@ -72,7 +72,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the dock has been/can be build or not. */ - bool BuildDock(TileIndex tile); + static bool BuildDock(TileIndex tile); /** * Builds a buoy on tile. @@ -80,7 +80,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the buoy has been/can be build or not. */ - bool BuildBuoy(TileIndex tile); + static bool BuildBuoy(TileIndex tile); /** * Builds a lock on tile. @@ -88,7 +88,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the lock has been/can be build or not. */ - bool BuildLock(TileIndex tile); + static bool BuildLock(TileIndex tile); /** * Builds a canal on tile. @@ -96,7 +96,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the canal has been/can be build or not. */ - bool BuildCanal(TileIndex tile); + static bool BuildCanal(TileIndex tile); /** * Removes a water depot. @@ -104,7 +104,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the water depot has been/can be removed or not. */ - bool RemoveWaterDepot(TileIndex tile); + static bool RemoveWaterDepot(TileIndex tile); /** * Removes a dock. @@ -112,7 +112,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the dock has been/can be removed or not. */ - bool RemoveDock(TileIndex tile); + static bool RemoveDock(TileIndex tile); /** * Removes a buoy. @@ -120,7 +120,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the buoy has been/can be removed or not. */ - bool RemoveBuoy(TileIndex tile); + static bool RemoveBuoy(TileIndex tile); /** * Removes a lock. @@ -128,7 +128,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the lock has been/can be removed or not. */ - bool RemoveLock(TileIndex tile); + static bool RemoveLock(TileIndex tile); /** * Removes a canal. @@ -136,7 +136,7 @@ * @pre tile is always positive and smaller than AIMap::GetMapSize(). * @return whether the canal has been/can be removed or not. */ - bool RemoveCanal(TileIndex tile); + static bool RemoveCanal(TileIndex tile); }; #endif /* AI_MARINE_HPP */ Index: src/ai/api/ai_marine.hpp.sq =================================================================== --- src/ai/api/ai_marine.hpp.sq (revision 12187) +++ src/ai/api/ai_marine.hpp.sq (working copy) @@ -20,17 +20,16 @@ SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsBuoyTile, "IsBuoyTile", 2, "xi"); SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsLockTile, "IsLockTile", 2, "xi"); SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsCanalTile, "IsCanalTile", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildWaterDepot, "BuildWaterDepot", 3, "xib"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildDock, "BuildDock", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildBuoy, "BuildBuoy", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildLock, "BuildLock", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildCanal, "BuildCanal", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveWaterDepot, "RemoveWaterDepot", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveDock, "RemoveDock", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveBuoy, "RemoveBuoy", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveLock, "RemoveLock", 2, "xi"); + SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveCanal, "RemoveCanal", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::BuildWaterDepot, "BuildWaterDepot", 3, "xib"); - SQAIMarine.DefSQMethod(engine, &AIMarine::BuildDock, "BuildDock", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::BuildBuoy, "BuildBuoy", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::BuildLock, "BuildLock", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::BuildCanal, "BuildCanal", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveWaterDepot, "RemoveWaterDepot", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveDock, "RemoveDock", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveBuoy, "RemoveBuoy", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveLock, "RemoveLock", 2, "xi"); - SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveCanal, "RemoveCanal", 2, "xi"); - SQAIMarine.PostRegister(engine); }