ScummVM API documentation
handler.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_HANDLER_H
23 #define PINK_HANDLER_H
24 
25 #include "common/str-array.h"
26 
27 #include "pink/objects/object.h"
28 
29 namespace Pink {
30 
31 class Condition;
32 class SideEffect;
33 class LeadActor;
34 class Actor;
35 
36 class Handler : public Object {
37 public:
38  ~Handler() override;
39  void deserialize(Archive &archive) override;
40  virtual void handle(Actor *actor);
41  bool isSuitable(const Actor *actor) const;
42 
43 protected:
44  void executeSideEffects(Actor *actor);
45 
46  Array<Condition *> _conditions;
47  Array<SideEffect *> _sideEffects;
48 };
49 
50 class Sequence;
51 class Sequencer;
52 
53 class HandlerSequences : public Handler {
54 public:
55  void deserialize(Archive &archive) override;
56  void handle(Actor *actor) override;
57 
58 protected:
59  virtual void authorSequence(Sequencer *sequencer, Sequence *sequence);
60 
61 protected:
62  StringArray _sequences;
63 };
64 
66  void authorSequence(Sequencer *sequencer, Sequence *sequence) override;
67 };
68 
70 public:
71  void toConsole() const override;
72 };
73 
75 public:
76  void deserialize(Archive &archive) override;
77  void toConsole() const override;
78 
79  const Common::String &getInventoryItem() const { return _inventoryItem; }
80  const Common::String &getRecipient() const { return _recipient; }
81 
82 private:
83  Common::String _inventoryItem;
84  Common::String _recipient;
85 };
86 
87 class HandlerTimerActions : public Handler {
88 public:
89  void toConsole() const override;
90  void deserialize(Archive &archive) override;
91  void handle(Actor *actor) override;
92 
93 private:
94  StringArray _actions;
95 };
96 
98  void authorSequence(Sequencer *sequencer, Sequence *sequence) override;
99 };
100 
101 } // End of namespace Pink
102 
103 #endif
Definition: archive.h:39
Definition: str.h:59
Definition: handler.h:87
Definition: sequencer.h:36
Definition: handler.h:53
Definition: handler.h:36
Definition: object.h:31
Definition: handler.h:69
Definition: archive.h:35
Definition: handler.h:97
Definition: handler.h:74
Definition: handler.h:65
Definition: actor.h:39
Definition: utils.h:30
Definition: sequence.h:34
Definition: utils.h:41