Emergency 20 Dokumentation  4.2.0
GangsterBlackoutMini.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
14 
15 
16 //[-------------------------------------------------------]
17 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
31  {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Public definitions ]
36  //[-------------------------------------------------------]
37  public:
38  static const uint32 GAMELOGIC_TYPE_ID; // "em5::GangsterBlackoutMini" game logic type ID
39 
40 
41  //[-------------------------------------------------------]
42  //[ Public methods ]
43  //[-------------------------------------------------------]
44  public:
46 
47  void setCar(qsf::Entity& entity);
48  void setTargetPointForDriving(qsf::Entity& entity);
49  void setBombPoint(qsf::Entity& entity);
50  void setTriggerPoint(qsf::Entity& entity);
51  void setTimeToDefuseBomb(qsf::Time time);
52  void setTimeToWaitForExplosion(qsf::Time time);
53 
54 
55  //[-------------------------------------------------------]
56  //[ Protected virtual em5::GangsterBaseLogic methods ]
57  //[-------------------------------------------------------]
58  protected:
59  void onSimulationUpdate(const qsf::JobArguments& jobArguments) override;
60  void onIdle() override;
61  void onUnitsSpotted(std::vector<SpottedUnit>& sightedPoliceUnits) override;
62  void onNoUnitsSpotted() override;
63 
64 
65  //[-------------------------------------------------------]
66  //[ Private data ]
67  //[-------------------------------------------------------]
68  private:
69  enum State
70  {
71  STATE_INIT,
72  STATE_ENTER_CAR,
73  STATE_DRIVE_TO_TARGET,
74  STATE_GO_TO_BOMB_POINT,
75  STATE_LAY_BOMB,
76  STATE_GO_TO_TRIGGER_POINT,
77  STATE_WAIT_AT_TRIGGER_POINT,
78  STATE_ESCAPE
79  };
80  State mState;
81 
83  qsf::WeakPtr<qsf::Entity> mTargetPointForDriving;
84  qsf::WeakPtr<qsf::Entity> mBombPoint;
85  qsf::WeakPtr<qsf::Entity> mTriggerPoint;
86  qsf::Time mTimeToDefuseBomb;
87  qsf::Time mTimeToWaitForExplosion;
88 
89  qsf::WeakPtr<qsf::Entity> mBombEntity;
90 
91 
92  //[-------------------------------------------------------]
93  //[ CAMP reflection system ]
94  //[-------------------------------------------------------]
95  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
96 
97 
98  };
99 
100 
101 //[-------------------------------------------------------]
102 //[ Namespace ]
103 //[-------------------------------------------------------]
104 } // em5
105 
106 
107 //[-------------------------------------------------------]
108 //[ CAMP reflection system ]
109 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
State
Definition: ProcessState.h:20
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
static const uint32 GAMELOGIC_TYPE_ID
Definition: GangsterBlackoutMini.h:38
Game logic for gangster type used in "City blackout" campaign mini-event.
Definition: GangsterBlackoutMini.h:30
Base game logic for gangster.
Definition: GangsterBaseLogic.h:52
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32