Emergency 20 Dokumentation  4.2.0
HintSystem.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 #include <qsf/audio/AudioProxy.h>
16 #include <qsf/time/Time.h>
17 
18 #include <boost/noncopyable.hpp>
19 
20 
21 //[-------------------------------------------------------]
22 //[ Forward declarations ]
23 //[-------------------------------------------------------]
24 namespace qsf
25 {
26  class JobArguments;
27 }
28 namespace em5
29 {
30  class SupervisorWindow;
31 }
32 
33 
34 //[-------------------------------------------------------]
35 //[ Namespace ]
36 //[-------------------------------------------------------]
37 namespace em5
38 {
39 
40 
41  //[-------------------------------------------------------]
42  //[ Classes ]
43  //[-------------------------------------------------------]
48  class EM5_API_EXPORT HintSystem : public boost::noncopyable
49  {
50 
51 
52  //[-------------------------------------------------------]
53  //[ Public methods ]
54  //[-------------------------------------------------------]
55  public:
60  HintSystem();
61 
66  virtual ~HintSystem();
67 
72  void addMessage(const std::string& messageId, HintMessage::MessageType messageType, uint32 playerIndex = qsf::getUninitialized<uint32>(0), qsf::Time blockedTime = qsf::Time::ZERO);
73 
78  void update(const qsf::JobArguments& jobArguments);
79 
84  void repeatLastHint();
85 
90  void stopCurrentHint();
91 
96  void clear();
97 
98  bool isSupervisorWindowOpen() const;
99 
100 
101  //[-------------------------------------------------------]
102  //[ Private methods ]
103  //[-------------------------------------------------------]
104  private:
105  void playHint(const HintMessage& hintMessage, bool ignoreAudioBlock = false);
106  uint64 getHintPlayerKey(const std::string& messageId, uint32 playerId);
107 
108 
109  //[-------------------------------------------------------]
110  //[ Private data ]
111  //[-------------------------------------------------------]
112  private:
113  std::list<HintMessage> mMessages;
114  std::list<HintMessage> mMessageHistory;
115  SupervisorWindow& mSupervisorWindow;
116  qsf::Time mCurrentTime;
117  qsf::JobProxy mUpdateJobProxy;
118 
119  std::map<uint64, qsf::Time> mBlockedHints;
120  std::map<uint64, qsf::Time> mRecentAudioHints;
121 
122 
123  };
124 
125 
126 //[-------------------------------------------------------]
127 //[ Namespace ]
128 //[-------------------------------------------------------]
129 } // em5
Definition: ActionPriority.h:13
Hint system knows how to trigger hints and delegates hint calls from gameplay to GUI.
Definition: HintSystem.h:48
Supervisor puppeteer.
Definition: SupervisorWindow.h:45
Job proxy class.
Definition: JobProxy.h:51
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
static const Time ZERO
A zero value for time.
Definition: Time.h:40
uint64_t uint64
Definition: PlatformTypes.h:184
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Definition: PickupPersonByParamedicAction.h:21
Hint message contains information about the text, sound file, video file the hint system needs...
Definition: HintMessage.h:32
MessageType
Definition: HintMessage.h:40
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32