(svn r18955) -Feature: [NoAI] introduce GetBuildCost functions in several classes to get easier cost estimations before you start building

This commit is contained in:
yexo
2010-01-29 23:56:42 +00:00
parent 93d93b3121
commit 16659e5516
15 changed files with 239 additions and 0 deletions

View File

@@ -103,6 +103,20 @@ public:
TRANSPORT_INVALID = -1, //!< Tile without any transport type.
};
/**
* 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.
@@ -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 */