Emergency 20 Dokumentation  4.2.0
ActivityPlayer.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/activity/Activity.h"
14 
15 #include <qsf/map/Entity.h>
16 #include <qsf/time/Time.h>
17 
18 
19 //[-------------------------------------------------------]
20 //[ Forward declarations ]
21 //[-------------------------------------------------------]
22 namespace qsf
23 {
24  class Clock;
25  class DebugDrawProxy;
26 }
27 
28 
29 //[-------------------------------------------------------]
30 //[ Namespace ]
31 //[-------------------------------------------------------]
32 namespace em5
33 {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Classes ]
38  //[-------------------------------------------------------]
44  {
45 
46 
47  //[-------------------------------------------------------]
48  //[ Public methods ]
49  //[-------------------------------------------------------]
50  public:
56 
61  virtual ~ActivityPlayer();
62 
63  bool isPlaying() const;
64 
65  void start(qsf::Entity& entity, Activity& activity);
66  void stop();
67 
72  void update(const qsf::Clock& clock);
73 
74  void writeDebugOutput(qsf::DebugDrawProxy& debugDrawProxy);
75 
76 
77  //[-------------------------------------------------------]
78  //[ Private methods ]
79  //[-------------------------------------------------------]
80  private:
81  bool switchToState(uint32 stateId);
82  bool switchToStep(uint32 stepIndex);
83 
84 
85  //[-------------------------------------------------------]
86  //[ Private data ]
87  //[-------------------------------------------------------]
88  private:
89  // Configuration
91  Activity* mActivity;
92 
93  // Activity player state
94  bool mIsPlaying;
95  uint32 mActivityLoadVersion;
96  uint32 mCurrentStateId;
97  const Activity::State* mCurrentState;
98  uint32 mCurrentStepIndex;
99  ActivityStep* mCurrentStep;
100  qsf::Time mCurrentStepTime;
101 
102 
103  };
104 
105 
106 //[-------------------------------------------------------]
107 //[ Namespace ]
108 //[-------------------------------------------------------]
109 } // em5
Definition: ActionPriority.h:13
virtual ~ActivityPlayer()
Destructor.
Definition: Activity.h:47
Entity class.
Definition: Entity.h:46
ActivityPlayer()
Default constructor.
unsigned int uint32
Definition: PlatformTypes.h:181
Clock class.
Definition: Clock.h:33
void writeDebugOutput(qsf::DebugDrawProxy &debugDrawProxy)
Activity player.
Definition: ActivityPlayer.h:43
Definition: PickupPersonByParamedicAction.h:21
void start(qsf::Entity &entity, Activity &activity)
Debug draw proxy class.
Definition: DebugDrawProxy.h:46
Activity class.
Definition: Activity.h:39
Activity step base class.
Definition: ActivityStep.h:44
bool isPlaying() const
void update(const qsf::Clock &clock)
Update the activity playback.
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32