ScummVM API documentation
qd_condition_group.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22
23#ifndef QDENGINE_QDCORE_QD_CONDITION_GROUP_H
24#define QDENGINE_QDCORE_QD_CONDITION_GROUP_H
25
26#include "qdengine/parser/xml_fwd.h"
27
28
29namespace QDEngine {
30
33public:
40 };
41
44
45 qdConditionGroup &operator = (const qdConditionGroup &cg);
46
48
49 typedef Std::vector<int> conditions_container_t;
50 typedef conditions_container_t::const_iterator conditions_iterator_t;
51
52 conditions_iterator_t conditions_begin() const {
53 return _conditions.begin();
54 }
55 conditions_iterator_t conditions_end() const {
56 return _conditions.end();
57 }
58
59 int conditions_size() const {
60 return _conditions.size();
61 }
62
63 conditions_mode_t conditions_mode() const {
64 return _conditions_mode;
65 }
66 void set_conditions_mode(conditions_mode_t mode) {
67 _conditions_mode = mode;
68 }
69
70 bool add_condition(int condition_id);
71 bool remove_condition(int condition_id);
72
73 bool load_script(const xml::tag *p);
74 bool save_script(Common::WriteStream &fh, int indent = 0) const;
75
76private:
77
78 conditions_mode_t _conditions_mode;
79 conditions_container_t _conditions;
80};
81
82} // namespace QDEngine
83
84#endif // QDENGINE_QDCORE_QD_CONDITION_GROUP_H
iterator end()
Definition: array.h:380
size_type size() const
Definition: array.h:316
iterator begin()
Definition: array.h:375
Definition: stream.h:77
Группа условий.
Definition: qd_condition_group.h:32
conditions_mode_t
Режим проверки условий.
Definition: qd_condition_group.h:35
@ CONDITIONS_AND
"И" - должны выполниться все условия.
Definition: qd_condition_group.h:37
@ CONDITIONS_OR
"ИЛИ" - достаточно выполнения одного из условий.
Definition: qd_condition_group.h:39
Базовый класс для игровых ресурсов.
Definition: console.h:28