Fix #10490: Allow ships to exit depots if another is not moving at the exit point...
[openttd-github.git] / src / script / api / script_grouplist.hpp
blobd85303b854176d2a20bd76374c0a639b2a561541
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file script_grouplist.hpp List all the groups (you own). */
10 #ifndef SCRIPT_GROUPLIST_HPP
11 #define SCRIPT_GROUPLIST_HPP
13 #include "script_list.hpp"
15 /**
16 * Creates a list of groups of which you are the owner.
17 * @note Neither ScriptGroup::GROUP_ALL nor ScriptGroup::GROUP_DEFAULT is in this list.
18 * @api ai game
19 * @ingroup ScriptList
21 class ScriptGroupList : public ScriptList {
22 public:
23 #ifdef DOXYGEN_API
24 /**
25 * @game @pre ScriptCompanyMode::IsValid().
27 ScriptGroupList();
29 /**
30 * Apply a filter when building the list.
31 * @param filter_function The function which will be doing the filtering.
32 * @param params The params to give to the filters (minus the first param,
33 * which is always the index-value).
34 * @game @pre ScriptCompanyMode::IsValid().
35 * @note You can write your own filters and use them. Just remember that
36 * the first parameter should be the index-value, and it should return
37 * a bool.
38 * @note Example:
39 * function IsType(group_id, type)
40 * {
41 * return ScriptGroup.GetVehicleType(group_id) == type;
42 * }
43 * ScriptGroupList(IsType, ScriptVehicle.VT_ROAD);
45 ScriptGroupList(void *filter_function, int params, ...);
46 #else
47 /**
48 * The constructor wrapper from Squirrel.
50 ScriptGroupList(HSQUIRRELVM vm);
51 #endif /* DOXYGEN_API */
54 #endif /* SCRIPT_GROUPLIST_HPP */