ScummVM API documentation
GameTypes.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  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of Penumbra Overture.
26  */
27 
28 #ifndef GAME_GAME_TYPES_H
29 #define GAME_GAME_TYPES_H
30 
31 #define kTranslate(asCat, asName) (mpInit->mpGame->GetResources()->Translate(asCat, asName))
32 
33 #define kCopyToVar(aVar, aVal) (aVar->aVal = aVal)
34 #define kCopyFromVar(aVar, aVal) (aVal = aVar->aVal)
35 
36 #include "hpl1/engine/engine.h"
37 #include "common/multimap.h"
38 
39 using namespace hpl;
40 
41 //---------------------------------
42 
44 // ENUMERATIONS
46 
47 //---------------------------------
48 
49 enum eButtonHandlerState {
50  eButtonHandlerState_Null,
51  eButtonHandlerState_Game,
52  eButtonHandlerState_MainMenu,
53  eButtonHandlerState_MapLoadText,
54  eButtonHandlerState_PreMenu,
55  eButtonHandlerState_Credits,
56  eButtonHandlerState_DemoEndText,
57  eButtonHandlerState_Intro
58 };
59 
60 //---------------------------------
61 
62 enum ePlayerMoveState {
63  ePlayerMoveState_Walk,
64  ePlayerMoveState_Run,
65  ePlayerMoveState_Still,
66  ePlayerMoveState_Jump,
67  ePlayerMoveState_Crouch,
68  ePlayerMoveState_LastEnum,
69 };
70 
71 //---------------------------------
72 
73 enum ePlayerState {
74  ePlayerState_Normal,
75  ePlayerState_Push,
76  ePlayerState_Move,
77  ePlayerState_InteractMode,
78  ePlayerState_UseItem,
79  ePlayerState_Message,
80  ePlayerState_Grab,
81  ePlayerState_WeaponMelee,
82  ePlayerState_Throw,
83  ePlayerState_Climb,
84  ePlayerState_LastEnum
85 };
86 
87 //---------------------------------
88 
89 enum ePlayerHandType {
90  ePlayerHandType_Normal,
91  ePlayerHandType_WeaponMelee,
92  ePlayerHandType_Throw,
93  ePlayerHandType_LastEnum
94 };
95 
96 //---------------------------------
97 
98 enum ePlayerDamageType {
99  ePlayerDamageType_BloodSplash,
100  ePlayerDamageType_Ice,
101  ePlayerDamageType_LastEnum
102 };
103 
104 //---------------------------------
105 
106 enum eCrossHairState {
107  eCrossHairState_Inactive,
108  eCrossHairState_Active,
109  eCrossHairState_Invalid,
110  eCrossHairState_Grab,
111  eCrossHairState_Examine,
112  eCrossHairState_Pointer,
113  eCrossHairState_Item,
114  eCrossHairState_DoorLink,
115  eCrossHairState_PickUp,
116  eCrossHairState_Ladder,
117  eCrossHairState_None,
118  eCrossHairState_Cross,
119  eCrossHairState_LastEnum
120 };
121 
122 //---------------------------------
123 
124 enum eGameDifficulty {
125  eGameDifficulty_Easy = 0,
126  eGameDifficulty_Normal = 1,
127  eGameDifficulty_Hard = 2,
128  eGameDifficulty_LastEnum
129 };
130 
131 //---------------------------------
132 
133 enum eGameEntityType {
134  eGameEntityType_Unknown,
135  eGameEntityType_Object,
136  eGameEntityType_Door,
137  eGameEntityType_DoorPanel,
138  eGameEntityType_Area,
139  eGameEntityType_Item,
140  eGameEntityType_Link,
141  eGameEntityType_Enemy,
142  eGameEntityType_SwingDoor,
143  eGameEntityType_StickArea,
144  eGameEntityType_SaveArea,
145  eGameEntityType_Lamp,
146  eGameEntityType_Ladder,
147  eGameEntityType_DamageArea,
148  eGameEntityType_ForceArea,
149  eGameEntityType_LiquidArea,
150  eGameEntityType_LastEnum
151 };
152 
153 //---------------------------------
154 
155 enum eObjectInteractMode {
156  eObjectInteractMode_Static,
157  eObjectInteractMode_Push,
158  eObjectInteractMode_Move,
159  eObjectInteractMode_Grab,
160  eObjectInteractMode_LastEnum,
161 };
162 
163 enum eGameDoorState {
164  eGameDoorState_Open,
165  eGameDoorState_Opening,
166  eGameDoorState_Closed,
167  eGameDoorState_Closing,
168  eGameDoorState_LastEnum,
169 };
170 
171 //---------------------------------
172 enum eGameEntityScriptType {
173  eGameEntityScriptType_PlayerInteract,
174  eGameEntityScriptType_PlayerExamine,
175  eGameEntityScriptType_PlayerPick,
176  eGameEntityScriptType_OnUpdate,
177  eGameEntityScriptType_OnBreak,
178  eGameEntityScriptType_LastEnum
179 };
180 
181 //---------------------------------
182 
183 enum eGameCollideScriptType {
184  eGameCollideScriptType_Enter,
185  eGameCollideScriptType_During,
186  eGameCollideScriptType_Leave,
187  eGameCollideScriptType_LastEnum
188 };
189 
190 //---------------------------------
191 
192 enum eGameItemType {
193  eGameItemType_Normal,
194  eGameItemType_Notebook,
195  eGameItemType_Note,
196  eGameItemType_Battery,
197  eGameItemType_Flashlight,
198  eGameItemType_Food,
199  eGameItemType_Map,
200  eGameItemType_GlowStick,
201  eGameItemType_Flare,
202  eGameItemType_Painkillers,
203  eGameItemType_WeaponMelee,
204  eGameItemType_Throw,
205  eGameItemType_LastEnum
206 };
207 
208 //---------------------------------
209 
210 enum eGameTriggerType {
211  eGameTriggerType_Sound = (1 << 0),
212 };
213 
214 //---------------------------------
215 
217 // CLASSES
219 
220 //-----------------------------------------
221 
222 class cGameTimer : public iSerializable {
223  kSerializableClassInit(cGameTimer) public : cGameTimer() : mbDeleteMe(false), mbPaused(false) {}
224 
225  tString msName;
226  tString msCallback;
227 
228  bool mbGlobal;
229 
230  float mfTime;
231 
232  bool mbDeleteMe;
233  bool mbPaused;
234 
235  const tString &GetName() { return msName; }
236 };
237 
238 //-----------------------------------------
239 
241  kSerializableClassInit(cInventoryUseCallback) public : tString msItem;
242  tString msObject;
243  tString msFunction;
244 };
245 
247 typedef tInventoryUseCallbackMap::iterator tInventoryUseCallbackMapIt;
248 
249 //-----------------------------------------
250 
252  kSerializableClassInit(cInventoryPickupCallback) public : tString msItem;
253  tString msFunction;
254 };
255 
257 typedef tInventoryPickupCallbackMap::iterator tInventoryPickupCallbackMapIt;
258 
259 //-----------------------------------------
260 
262  kSerializableClassInit(cInventoryCombineCallback) public : tString msItem1;
263  tString msItem2;
264  tString msFunction;
265  bool bKillMe;
266 };
267 
270 
271 //---------------------------------
272 class iGameEntity;
274 public:
276 
277  tString msFuncName[3];
278 
279  iGameEntity *mpEntity;
280  bool mbCollides;
281  bool mbDeleteMe;
282 };
283 
285 typedef tGameCollideScriptMap::iterator tGameCollideScriptMapIt;
286 
287 //---------------------------------
288 
290  kSerializableClassInit(cSaveGame_cGameCollideScript) public : void LoadFrom(cGameCollideScript *apScript);
291  void SaveTo(cGameCollideScript *apScript);
292 
293  tString msFuncName[3];
294  tString msEntity;
295  bool mbCollides;
296 };
297 
298 //---------------------------------
299 
300 #endif // GAME_GAME_TYPES_H
Definition: AI.h:36
Definition: str.h:59
typename TreeT::BasicIterator iterator
Definition: stablemap.h:48
Definition: GameTypes.h:251
Definition: SerializeClass.h:230
Definition: GameTypes.h:289
Definition: GameTypes.h:273
Definition: GameTypes.h:240
Definition: GameTypes.h:222
Definition: list_intern.h:51
Definition: GameEntity.h:126
Definition: GameTypes.h:261