(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

@@ -81,6 +81,17 @@ public:
SIGNALTYPE_NONE = 0xFF, //!< No signal.
};
/**
* Types of rail-related objects in the game.
*/
enum BuildType {
BT_TRACK, //!< Build a track
BT_SIGNAL, //!< Build a signal
BT_DEPOT, //!< Build a depot
BT_STATION, //!< Build a station
BT_WAYPOINT, //!< Build a rail waypoint
};
/**
* Checks whether the given tile is actually a tile with rail that can be
* used to traverse a tile. This excludes rail depots but includes
@@ -419,6 +430,15 @@ public:
* @return Whether the signal has been/can be removed or not.
*/
static bool RemoveSignal(TileIndex tile, TileIndex front);
/**
* Get the baseprice of building a rail-related object.
* @param railtype the railtype that is build (on)
* @param build_type the type of object to build
* @pre IsRailTypeAvailable(railtype)
* @return The baseprice of building the given object.
*/
static Money GetBuildCost(RailType railtype, BuildType build_type);
};
#endif /* AI_RAIL_HPP */