summaryrefslogtreecommitdiff
path: root/src/rail.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-09 21:05:03 +0000
committerrubidium <rubidium@openttd.org>2008-01-09 21:05:03 +0000
commit998d7644f6a1b58de0b06d539c0436808b1f1e95 (patch)
tree6b9fc11a0135e1ccdb74151dd8962e4fd5264843 /src/rail.h
parent82fe2885abb359c813908b0c844533bfec2c2b22 (diff)
downloadopenttd-998d7644f6a1b58de0b06d539c0436808b1f1e95.tar.xz
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
Diffstat (limited to 'src/rail.h')
-rw-r--r--src/rail.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/rail.h b/src/rail.h
index 8ba804c6e..a789b57eb 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -64,10 +64,10 @@ struct RailtypeInfo {
SpriteID snow_offset;
/** bitmask to the OTHER railtypes on which an engine of THIS railtype generates power */
- RailTypeMask powered_railtypes;
+ RailTypes powered_railtypes;
/** bitmask to the OTHER railtypes on which an engine of THIS railtype can physically travel */
- RailTypeMask compatible_railtypes;
+ RailTypes compatible_railtypes;
/**
* Offset between the current railtype and normal rail. This means that:<p>
@@ -201,4 +201,35 @@ Foundation GetRailFoundation(Slope tileh, TrackBits bits);
int32 SettingsDisableElrail(int32 p1); ///< _patches.disable_elrail callback
+/**
+ * Finds out if a Player has a certain railtype available
+ * @param p Player in question
+ * @param railtype requested RailType
+ * @return true if player has requested RailType available
+ */
+bool HasRailtypeAvail(const PlayerID p, const RailType railtype);
+
+/**
+ * Validate functions for rail building.
+ * @param rail the railtype to check.
+ * @return true if the current player may build the rail.
+ */
+bool ValParamRailtype(const RailType rail);
+
+/**
+ * Returns the "best" railtype a player can build.
+ * As the AI doesn't know what the BEST one is, we have our own priority list
+ * here. When adding new railtypes, modify this function
+ * @param p the player "in action"
+ * @return The "best" railtype a player has available
+ */
+RailType GetBestRailtype(const PlayerID p);
+
+/**
+ * Get the rail types the given player can build.
+ * @param p the player to get the rail types for.
+ * @return the rail types.
+ */
+RailTypes GetPlayerRailtypes(const PlayerID p);
+
#endif /* RAIL_H */