Emergency 20 Dokumentation  4.2.0
Em20MainEventBase.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  //[ Friends ]
36  //[-------------------------------------------------------]
37  friend class MainEventMetaclasses; // CAMP export of editable values for Game Design
38 
39 
40  //[-------------------------------------------------------]
41  //[ Public methods ]
42  //[-------------------------------------------------------]
43  public:
48  Em20MainEventBase(const std::string& eventLayerName);
49 
54  virtual ~Em20MainEventBase();
55 
56 
57  //[-------------------------------------------------------]
58  //[ Public virtual em5::FreeplayEvent methods ]
59  //[-------------------------------------------------------]
60  public:
61  virtual bool onStartup() override;
62  virtual void onRun() override;
63  virtual bool onSuccess(EventResult& eventResult) override;
64  virtual bool onFailure(EventResult& eventResult) override;
65  virtual uint32 calculatePointGain(EventResult& eventResult) override;
66 
67 
68  //[-------------------------------------------------------]
69  //[ Protected virtual em5::MainEvent methods ]
70  //[-------------------------------------------------------]
71  protected:
72  virtual void onIntroStart(const qsf::MessageParameters& parameters) override;
73  virtual void onPrologueFinished(const qsf::MessageParameters& parameters) override;
74  virtual void showSupervisorMessageForFinalEvaluation(uint32 pointGain) override;
75 
76 
77  //[-------------------------------------------------------]
78  //[ Protected virtual em5::Em20MainEventBase methods ]
79  //[-------------------------------------------------------]
80  protected:
81  virtual void onUnitSetup(qsf::Entity& entity, uint32 unitTypeId) {}
82 
83 
84  //[-------------------------------------------------------]
85  //[ Protected methods ]
86  //[-------------------------------------------------------]
87  protected:
88  void startIngameCutscene(const std::string& sequenceLocalAssetName);
89  void setMusicLevel(uint32 musicLevel);
90  void stopCurrentHints();
91 
92 
93  //[-------------------------------------------------------]
94  //[ Private methods ]
95  //[-------------------------------------------------------]
96  private:
97  void onUnitSetupInternal(const qsf::MessageParameters& parameters);
98  void onEntitySpawn(const qsf::MessageParameters& parameters);
99  void onAllowGameSpeedChanges(const qsf::JobArguments& jobArguments);
100  void updateTrackInjureds(const qsf::JobArguments& jobArguments);
101 
102 
103  //[-------------------------------------------------------]
104  //[ Protected data ]
105  //[-------------------------------------------------------]
106  protected:
107  // Connected to CAMP
110 
111  // Internal
113 
114 
115  //[-------------------------------------------------------]
116  //[ Private data ]
117  //[-------------------------------------------------------]
118  private:
119  // Internal
120  qsf::MessageProxy mUnitSetupMessageProxy;
121  qsf::MessageProxy mEntitySpawnMessageProxy;
122 
123  // Jobs
124  qsf::JobProxy mAllowGameSpeedChangesJobProxy;
125  qsf::JobProxy mTrackInjuredsJobProxy;
126 
127 
128  //[-------------------------------------------------------]
129  //[ CAMP reflection system ]
130  //[-------------------------------------------------------]
131  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
132 
133 
134  };
135 
136 
137 //[-------------------------------------------------------]
138 //[ Namespace ]
139 //[-------------------------------------------------------]
140 } // em5
141 
142 
143 //[-------------------------------------------------------]
144 //[ CAMP reflection system ]
145 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Definition: FreeplayEvent.h:110
virtual void onRun() override
React to state change from (initial) hidden state to running state.
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
Message parameters class.
Definition: MessageParameters.h:34
virtual void showSupervisorMessageForFinalEvaluation(uint32 pointGain) override
Shows a supervisor message when the event ends.
virtual void onPrologueFinished(const qsf::MessageParameters &parameters) override
React to the end of the prologue.
EMERGENCY 5 main event base class.
Definition: MainEvent.h:48
unsigned int uint32
Definition: PlatformTypes.h:181
Em20MainEventBase(const std::string &eventLayerName)
Constructor.
Message listener proxy class.
Definition: MessageProxy.h:47
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
uint32 mFailLimitLostUnits
Definition: Em20MainEventBase.h:109
virtual uint32 calculatePointGain(EventResult &eventResult) override
Calculate the point gain for this event.
virtual ~Em20MainEventBase()
Destructor.
virtual bool onSuccess(EventResult &eventResult) override
React to state change from running state to success state.
virtual bool onFailure(EventResult &eventResult) override
React to state change from running state to failed state.
virtual void onIntroStart(const qsf::MessageParameters &parameters) override
React to the activation of the black screen, which is the start of the intro cutscene.
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
EMERGENCY 20 years edition mission base class.
Definition: Em20MainEventBase.h:30
virtual void onUnitSetup(qsf::Entity &entity, uint32 unitTypeId)
Definition: Em20MainEventBase.h:81
bool mDisableVehicleTowing
Definition: Em20MainEventBase.h:112
uint32 mFailLimitDeadPersons
Definition: Em20MainEventBase.h:108
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
void setMusicLevel(uint32 musicLevel)
Static CAMP main event plugin metaclass collection class.
Definition: MainEventMetaclasses.h:30
virtual bool onStartup() override
React to startup of the freeplay event.
void startIngameCutscene(const std::string &sequenceLocalAssetName)