ScummVM API documentation
TriggerHandler.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_TRIGGER_HANDLER_H
29 #define GAME_TRIGGER_HANDLER_H
30 
31 #include "hpl1/engine/engine.h"
32 
33 #include "hpl1/penumbra-overture/GameTypes.h"
34 
35 using namespace hpl;
36 
37 class cInit;
38 class cMapHandler;
39 
40 //----------------------------------------
41 
42 class cGameTrigger : public iEntity3D {
43  friend class cTriggerHandler;
44 
45 public:
46  cGameTrigger();
47  virtual ~cGameTrigger() {}
48 
49  int GetPrio() { return mlPrio; }
50  float GetTimeCount() { return mfTimeCount; }
51  eGameTriggerType GetType() { return mType; }
52 
53  float GetRadius() { return mfRadius; }
54  void SetRadius(float afX);
55 
56  cBoundingVolume *GetBoundingVolume() { return &mBoundingVolume; }
57 
58  virtual tString GetEntityType() { return "GameTrigger"; }
59 
60 protected:
61  int mlPrio;
62  float mfTimeCount;
63  eGameTriggerType mType;
64 
65 private:
66  float mfRadius;
67 };
68 
70 typedef tGameTriggerMap::iterator tGameTriggerMapIt;
71 
72 //----------------------------------------
73 
74 class cTriggerHandler : public iUpdateable {
75 public:
76  cTriggerHandler(cInit *apInit);
77  ~cTriggerHandler();
78 
79  cGameTrigger *Add(cGameTrigger *apTrigger, eGameTriggerType aType, const cVector3f &avLocalPos,
80  int alPrio, float afTime, float afRadius);
81 
82  void OnStart();
83  void Update(float afTimeStep);
84  void Reset();
85 
86 private:
87  cInit *mpInit;
88  cMapHandler *mpMapHandler;
89 
90  tGameTriggerMap m_mapTriggers;
91 };
92 
93 #endif // GAME_TRIGGER_HANDLER_H
Definition: AI.h:36
Definition: str.h:59
Definition: TriggerHandler.h:42
Definition: BoundingVolume.h:71
Definition: multimap.h:34
Definition: TriggerHandler.h:74
Definition: Updateable.h:35
Definition: Entity3D.h:81
Definition: MapHandler.h:155
Definition: Init.h:70