ScummVM API documentation
condition.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 #ifndef PINK_CONDITION_H
23 #define PINK_CONDITION_H
24 
25 #include "pink/objects/object.h"
26 
27 namespace Pink {
28 
29 class Actor;
30 
31 class Condition : public Object {
32 public:
33  void deserialize(Archive &archive) override = 0;
34  virtual bool evaluate(const Actor *actor) const = 0;
35 };
36 
37 class ConditionVariable : public Condition {
38 public:
39 
40  void deserialize(Archive &archive) override;
41  bool evaluate(const Actor *actor) const override = 0;
42 
43 protected:
44  Common::String _name;
45  Common::String _value;
46 };
47 
49 public:
50  void toConsole() const override;
51  bool evaluate(const Actor *actor) const override;
52 };
53 
54 /*
55  * It is not used in games and has evaluate method with infinity recursion
56 class ConditionNotGameVariable : public ConditionGameVariable {
57  virtual bool evaluate(LeadActor *leadActor);
58 };
59  */
60 
62 public:
63  void toConsole() const override;
64  bool evaluate(const Actor *actor) const override;
65 };
66 
68 public:
69  void toConsole() const override;
70  bool evaluate(const Actor *actor) const override;
71 };
72 
74 public:
75  void toConsole() const override;
76  bool evaluate(const Actor *actor) const override;
77 };
78 
80 public:
81  void toConsole() const override;
82  bool evaluate(const Actor *actor) const override;
83 };
84 
86 public:
87  void toConsole() const override;
88  void deserialize(Archive &archive) override;
89  bool evaluate(const Actor *actor) const override;
90 
91 protected:
92  Common::String _item;
93  Common::String _owner;
94 };
95 
97 public:
98  void toConsole() const override;
99  bool evaluate(const Actor *actor) const override;
100 };
101 
102 } // End of namespace Pink
103 
104 #endif
Definition: archive.h:39
Definition: str.h:59
Definition: condition.h:48
Definition: condition.h:85
Definition: object.h:31
Definition: archive.h:35
Definition: condition.h:37
Definition: condition.h:31
Definition: condition.h:79
Definition: condition.h:61
Definition: condition.h:67
Definition: condition.h:73
Definition: actor.h:39
Definition: condition.h:96