ScummVM API documentation
GameSwingDoor.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_SWING_DOOR_H
29 #define GAME_GAME_SWING_DOOR_H
30 
31 #include "hpl1/engine/engine.h"
32 #include "hpl1/penumbra-overture/GameEntity.h"
33 
34 using namespace hpl;
35 
36 //----------------------------------------------
37 
39  kSerializableClassInit(cGameSwingDoor_SaveData);
40 
41 public:
42  bool mbLocked;
43 
44  tString msBreakSound;
45  tString msBreakEntity;
46  tString msBreakPS;
47 
48  iGameEntity *CreateEntity();
49 };
50 
51 //----------------------------------------------
52 
54 public:
55  float mfMin;
56  float mfMax;
57 };
58 //----------------------------------------------
59 
60 class cGameSwingDoor : public iGameEntity {
61  typedef iGameEntity super;
62  friend class cEntityLoader_GameSwingDoor;
63 
64 public:
65  cGameSwingDoor(cInit *apInit, const tString &asName);
66  ~cGameSwingDoor(void);
67 
68  void OnPlayerInteract();
69  void OnPlayerPick();
70 
71  void Update(float afTimeStep);
72 
73  void OnDamage(float afDamage);
74  void OnDeath(float afDamage);
75 
76  void BreakAction();
77 
78  void SetupBreakObject();
79 
80  void SetupPhysics(cWorld3D *apWorld);
81 
82  void SetLocked(bool abX);
83 
84  // SaveObject implementation
85  iGameEntity_SaveData *CreateSaveData();
86  void SaveToSaveData(iGameEntity_SaveData *apSaveData);
87  void LoadFromSaveData(iGameEntity_SaveData *apSaveData);
88 
89 private:
90  Common::Array<iPhysicsController *> mvStopControllers;
92 
93  bool mbLocked;
94 
95  tString msBreakSound;
96  tString msBreakEntity;
97  tString msBreakPS;
98 };
99 
100 //--------------------------------------
101 
103 public:
104  cEntityLoader_GameSwingDoor(const tString &asName, cInit *apInit);
106 
107 private:
108  void BeforeLoad(TiXmlElement *apRootElem, const cMatrixf &a_mtxTransform, cWorld3D *apWorld);
109  void AfterLoad(TiXmlElement *apRootElem, const cMatrixf &a_mtxTransform, cWorld3D *apWorld);
110 
111  cInit *mpInit;
112 };
113 
114 #endif // GAME_GAME_SWING_DOOR_H
Definition: AI.h:36
Definition: str.h:59
Definition: array.h:52
Definition: GameSwingDoor.h:60
Definition: GameEntity.h:76
Definition: World3D.h:179
Definition: GameSwingDoor.h:38
Definition: GameSwingDoor.h:53
Definition: EntityLoader_Object.h:52
Definition: tinyxml.h:864
Definition: GameEntity.h:126
Definition: Init.h:70
Definition: GameSwingDoor.h:102