summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_tile.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-01-29 23:56:42 +0000
committeryexo <yexo@openttd.org>2010-01-29 23:56:42 +0000
commit15016e3511b075e999cdb0db45936d5e6b223aa4 (patch)
treed053d2759a7c64b76e429d0367216567ec051534 /src/ai/api/ai_tile.hpp
parent54f958c8e5c99804d1e46c2fe6b3b5ef5cae3db6 (diff)
downloadopenttd-15016e3511b075e999cdb0db45936d5e6b223aa4.tar.xz
(svn r18955) -Feature: [NoAI] introduce GetBuildCost functions in several classes to get easier cost estimations before you start building
Diffstat (limited to 'src/ai/api/ai_tile.hpp')
-rw-r--r--src/ai/api/ai_tile.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ai/api/ai_tile.hpp b/src/ai/api/ai_tile.hpp
index 9ba0df031..be5f8ff7d 100644
--- a/src/ai/api/ai_tile.hpp
+++ b/src/ai/api/ai_tile.hpp
@@ -104,6 +104,20 @@ public:
};
/**
+ * Get the base cost for building/clearing several things.
+ */
+ enum BuildType {
+ BT_FOUNDATION, //!< Build a foundation under something
+ BT_TERRAFORM, //!< Terraform
+ BT_BUILD_TREES, //!< Build trees
+ BT_CLEAR_GRASS, //!< Clear a tile with just grass
+ BT_CLEAR_ROUGH, //!< Clear a rough tile
+ BT_CLEAR_ROCKY, //!< Clear a tile with rocks
+ BT_CLEAR_FIELDS, //!< Clear a tile with farm fields
+ BT_CLEAR_HOUSE, //!< Clear a tile with a house
+ };
+
+ /**
* Check if this tile is buildable, i.e. no things on it that needs
* demolishing.
* @param tile The tile to check on.
@@ -435,6 +449,13 @@ public:
* @return The TownID of the town closest to the tile.
*/
static TownID GetClosestTown(TileIndex tile);
+
+ /**
+ * Get the baseprice of building/clearing various tile-related things.
+ * @param build_type the type to build
+ * @return The baseprice of building or removing the given object.
+ */
+ static Money GetBuildCost(BuildType build_type);
};
#endif /* AI_TILE_HPP */