ScummVM API documentation
ai_action.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  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_AI_AIACTION_H
26 #define PEGASUS_AI_AIACTION_H
27 
28 #include "common/list.h"
29 
30 #include "pegasus/input.h"
31 #include "pegasus/types.h"
32 
33 namespace Pegasus {
34 
35 class AIRule;
36 class AITimerCondition;
37 
39 //
40 // AIAction
41 
42 class AIAction {
43 friend class AIRule;
44 public:
45  AIAction() { _actionCount = 1; }
46  virtual ~AIAction() {}
47 
48  virtual void performAIAction(AIRule *) = 0;
49 
50  void setActionCount(const uint32 count) { _actionCount = count; }
51 
52 protected:
53  uint32 _actionCount;
54 };
55 
57 
59 //
60 // AICompoundAction
61 
62 class AICompoundAction : public AIAction {
63 public:
64  AICompoundAction() {}
65  ~AICompoundAction() override;
66 
67  void addAction(AIAction *action) { _compoundActions.push_back(action); }
68 
69  void performAIAction(AIRule *) override;
70 
71 protected:
72  AIActionList _compoundActions;
73 };
74 
76 //
77 // AIPlayMessageAction
78 
79 class AIPlayMessageAction : public AIAction {
80 public:
81  AIPlayMessageAction(const Common::Path &movieName, bool keepLastFrame, const InputBits = kWarningInterruption);
82 
83  void performAIAction(AIRule *) override;
84 
85 protected:
86  Common::Path _movieName;
87  InputBits _interruptionFilter;
88  bool _keepLastFrame;
89 };
90 
92 //
93 // AIStartTimerAction
94 
95 class AIStartTimerAction : public AIAction {
96 public:
98 
99  void performAIAction(AIRule *) override;
100 
101 protected:
102  AITimerCondition *_timerCondition;
103 };
104 
106 //
107 // AIActivateRuleAction
108 
110 public:
112 
113  void performAIAction(AIRule *) override;
114 
115 protected:
116  AIRule *_rule;
117 };
118 
120 //
121 // AIDeactivateRuleAction
122 
124 public:
126 
127  void performAIAction(AIRule *) override;
128 
129 protected:
130  AIRule *_rule;
131 };
132 
133 } // End of namespace Pegasus
134 
135 #endif
Definition: ai_condition.h:125
Definition: ai_action.h:123
Definition: path.h:52
Definition: ai_action.h:79
Definition: ai_rule.h:43
Definition: ai_action.h:62
Definition: ai_action.h:109
Definition: ai_action.h:95
Definition: ai_action.h:42
Definition: ai_action.h:33