Emergency 20 Dokumentation  4.2.0
HintHelper.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 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
15 #include <qsf/time/Time.h>
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  class Entity;
24  class MessageConfiguration;
25 }
26 namespace em5
27 {
28  class EventHintParameters;
29  class FreeplayEvent;
30 }
31 
32 
33 //[-------------------------------------------------------]
34 //[ Namespace ]
35 //[-------------------------------------------------------]
36 namespace em5
37 {
38 
39 
40  //[-------------------------------------------------------]
41  //[ Classes ]
42  //[-------------------------------------------------------]
48  {
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public definitions ]
53  //[-------------------------------------------------------]
54  public:
55  typedef std::vector<std::string> StringArray;
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public static methods ]
60  //[-------------------------------------------------------]
61  public:
69  static std::string getRandomStringOfStringArray(StringArray& stringArray);
70 
75  static std::string getRandomStringOfIdString(const std::string& idString);
76 
77  static void showHint(const std::string& hintId, uint32 playerIndex = qsf::getUninitialized<uint32>(0), qsf::Time blockedTime = qsf::Time::ZERO);
78  static void showTextHint(const std::string& hintId, uint32 playerIndex = qsf::getUninitialized<uint32>(0), qsf::Time blockedTime = qsf::Time::ZERO);
79  static void showUnitHint(const std::string& unitHintId, uint32 playerIndex = qsf::getUninitialized<uint32>(0), qsf::Time blockedTime = qsf::Time::ZERO);
80  static void showSupervisorMessage(const std::string& messageId, bool audioOnly = false);
81 
86  static void clearHints();
87 
88 
89  //[-------------------------------------------------------]
90  //[ Public methods ]
91  //[-------------------------------------------------------]
92  public:
97  explicit HintHelper(FreeplayEvent& freeplayEvent);
98 
103  ~HintHelper();
104 
109  EventHintParameters& getHintParameters() const;
110 
111  //[-------------------------------------------------------]
112  //[ Helper methods ]
113  //[-------------------------------------------------------]
114  // Create and initialize observers
115  void createAndInitializeHintsAtLowHealth(const qsf::Entity& targetEntity) const;
116  void createAndInitializeHintsAtLowLife(const qsf::Entity& targetEntity) const;
117  void createAndInitializeHintsAtInjured(const qsf::Entity& targetEntity) const;
118 
119  // Create and initialize general observers
120  void createAndInitializeGeneralHintAtDamagedVehicle() const;
121  void createAndInitializeGeneralHintAtInfectedObserver() const;
122  void createAndInitializeGeneralHintsAtInjured() const;
123  void createAndInitializeGeneralHintsForMessageObserver(const qsf::MessageConfiguration& messageConfiguration, const qsf::Time& timeFrame, const bool messageCreated) const;
124 
125 
126  //[-------------------------------------------------------]
127  //[ Private data ]
128  //[-------------------------------------------------------]
129  private:
130  FreeplayEvent& mEvent;
131 
132 
133  };
134 
135 
136 //[-------------------------------------------------------]
137 //[ Namespace ]
138 //[-------------------------------------------------------]
139 } // em5
Definition: ActionPriority.h:13
Hint helper can create hint observers.
Definition: HintHelper.h:47
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
std::vector< std::string > StringArray
Definition: HintHelper.h:55
static const Time ZERO
A zero value for time.
Definition: Time.h:40
Definition: PickupPersonByParamedicAction.h:21
Freeplay event hint parameters class.
Definition: EventHintParameters.h:35
Message configuration class.
Definition: MessageConfiguration.h:44
Abstract EMERGENCY 5 freeplay event base class.
Definition: FreeplayEvent.h:66
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32