Update: Translations from eints
[openttd-github.git] / src / script / api / script_signlist.hpp
blobe814b441efa2c5630a5fe6bae18f48f4d86e3969
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_signlist.hpp List all the signs of your company. */
10 #ifndef SCRIPT_SIGNLIST_HPP
11 #define SCRIPT_SIGNLIST_HPP
13 #include "script_list.hpp"
15 /**
16 * Create a list of signs your company has created.
17 * @api ai game
18 * @ingroup ScriptList
20 class ScriptSignList : public ScriptList {
21 public:
22 #ifdef DOXYGEN_API
23 ScriptSignList();
25 /**
26 * Apply a filter when building the list.
27 * @param filter_function The function which will be doing the filtering.
28 * @param ... The params to give to the filters (minus the first param,
29 * which is always the index-value).
30 * @note You can write your own filters and use them. Just remember that
31 * the first parameter should be the index-value, and it should return
32 * a bool.
33 * @note Example:
34 * @code
35 * function Contains(sign_id, str)
36 * {
37 * local name = ScriptSign.GetName(sign_id);
38 * return name != null && name.find(str) != null;
39 * }
40 * local signs = ScriptSignList(Contains, "something");
41 * @endcode
43 ScriptSignList(function filter_function, ...);
44 #else
45 ScriptSignList(HSQUIRRELVM);
46 #endif /* DOXYGEN_API */
49 #endif /* SCRIPT_SIGNLIST_HPP */