ScummVM API documentation
GameLadder.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_LADDER_H
29 #define GAME_GAME_LADDER_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(cGameLadder_SaveData);
40 
41 public:
42  cVector3f mvSize;
43 
44  tString msAttachSound;
45  tString msClimbUpSound;
46  tString msClimbDownSound;
47 
48  iGameEntity *CreateEntity();
49 };
50 
51 //------------------------------------------
52 
53 class cGameLadder : public iGameEntity {
54  typedef iGameEntity super;
55  friend class cAreaLoader_GameLadder;
56 
57 public:
58  cGameLadder(cInit *apInit, const tString &asName);
59  ~cGameLadder(void);
60 
61  void OnPlayerPick();
62  void OnPlayerInteract();
63 
64  void OnPostSceneDraw();
65 
66  void Setup();
67 
68  float GetDist2D();
69  float GetHeight();
70 
71  const cVector3f &GetForward() { return mvForward; }
72  float GetMaxY() { return mfMaxY; }
73  float GetMinY() { return mfMinY; }
74 
75  const tString &GetAttachSound() { return msAttachSound; }
76  const tString &GetClimbUpSound() { return msClimbUpSound; }
77  const tString &GetClimbDownSound() { return msClimbDownSound; }
78 
79  void SetAttachSound(const tString &asX) { msAttachSound = asX; }
80  void SetClimbUpSound(const tString &asX) { msClimbUpSound = asX; }
81  void SetClimbDownSound(const tString &asX) { msClimbDownSound = asX; }
82 
83  cVector3f GetStartRotation();
84  cVector3f GetStartPosition();
85 
86  // SaveObject implementation
87  iGameEntity_SaveData *CreateSaveData();
88  void SaveToSaveData(iGameEntity_SaveData *apSaveData);
89  void LoadFromSaveData(iGameEntity_SaveData *apSaveData);
90 
91 private:
92  cVector3f mvForward;
93  float mfMaxY;
94  float mfMinY;
95 
96  tString msAttachSound;
97  tString msClimbUpSound;
98  tString msClimbDownSound;
99 };
100 
101 //--------------------------------------
102 
104 
105 public:
106  cAreaLoader_GameLadder(const tString &asName, cInit *apInit);
108 
109  iEntity3D *Load(const tString &asName, const cVector3f &avSize, const cMatrixf &a_mtxTransform, cWorld3D *apWorld);
110 
111 private:
112  cInit *mpInit;
113 };
114 
115 #endif // GAME_GAME_LADDER_H
Definition: AI.h:36
Definition: GameLadder.h:103
Definition: str.h:59
Definition: GameEntity.h:76
Definition: GameLadder.h:38
Definition: World3D.h:179
Definition: Entity3D.h:81
Definition: Resources.h:133
Definition: GameLadder.h:53
Definition: GameEntity.h:126
Definition: Init.h:70