Add: AI functions to set/get vehicle group parent.

This commit is contained in:
Peter Nelson
2019-02-13 21:18:44 +00:00
committed by Niels Martin Hansen
parent 8139b14e9c
commit b62452903a
4 changed files with 38 additions and 0 deletions

View File

@@ -84,6 +84,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.