summaryrefslogtreecommitdiff
path: root/src/script/api/script_group.hpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2019-02-13 22:18:33 +0000
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-03-03 09:15:39 +0100
commit3c047b124e28db45621de06d5556c96598352fc7 (patch)
treed347611d01fe873c42ac1a9da9220d3ef7deb4ce /src/script/api/script_group.hpp
parentb62452903a3af9e51dc308fd674a788214942382 (diff)
downloadopenttd-3c047b124e28db45621de06d5556c96598352fc7.tar.xz
Add: AI functions to get current and last year profit of a group.
Diffstat (limited to 'src/script/api/script_group.hpp')
-rw-r--r--src/script/api/script_group.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/script/api/script_group.hpp b/src/script/api/script_group.hpp
index 7b375e29a..c5f41cdb6 100644
--- a/src/script/api/script_group.hpp
+++ b/src/script/api/script_group.hpp
@@ -189,6 +189,22 @@ public:
* @return True if and if the replacing was successfully stopped.
*/
static bool StopAutoReplace(GroupID group_id, EngineID engine_id);
+
+ /**
+ * Get the current profit of a group.
+ * @param group_id The group to get the profit of.
+ * @pre IsValidGroup(group_id).
+ * @return The current profit the group has.
+ */
+ static Money GetProfitThisYear(GroupID group_id);
+
+ /**
+ * Get the profit of last year of a group.
+ * @param group_id The group to get the profit of.
+ * @pre IsValidGroup(group_id).
+ * @return The current profit the group had last year.
+ */
+ static Money GetProfitLastYear(GroupID group_id);
};
#endif /* SCRIPT_GROUP_HPP */