diff options
author | Peter Nelson <peter1138@openttd.org> | 2019-02-13 21:18:44 +0000 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2019-03-03 09:15:39 +0100 |
commit | b62452903a3af9e51dc308fd674a788214942382 (patch) | |
tree | 0b4f1f1755714e0cb6ddf1877b00a8e23994239b /src/script/api/script_group.hpp | |
parent | 8139b14e9c941433bce74e46a7330123cae4ae2b (diff) | |
download | openttd-b62452903a3af9e51dc308fd674a788214942382.tar.xz |
Add: AI functions to set/get vehicle group parent.
Diffstat (limited to 'src/script/api/script_group.hpp')
-rw-r--r-- | src/script/api/script_group.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/script/api/script_group.hpp b/src/script/api/script_group.hpp index fd8888a17..7b375e29a 100644 --- a/src/script/api/script_group.hpp +++ b/src/script/api/script_group.hpp @@ -85,6 +85,24 @@ public: static char *GetName(GroupID group_id); /** + * Set parent group of a group. + * @param group_id The group to set the parent for. + * @param parent_group_id The parent group to set. + * @pre IsValidGroup(group_id). + * @pre IsValidGroup(parent_group_id). + * @return True if and only if the parent group was changed. + */ + static bool SetParent(GroupID group_id, GroupID parent_group_id); + + /** + * Get parent group of a group. + * @param group_id The group to get the parent of. + * @pre IsValidGroup(group_id). + * @return The group id of the parent group. + */ + static GroupID GetParent(GroupID group_id); + + /** * Enable or disable autoreplace protected. If the protection is * enabled, global autoreplace won't affect vehicles in this group. * @param group_id The group to change the protection for. |