Emergency 20 Dokumentation  4.2.0
LightTimeControlComponent-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Includes ]
6 //[-------------------------------------------------------]
8 
9 
10 //[-------------------------------------------------------]
11 //[ Namespace ]
12 //[-------------------------------------------------------]
13 namespace em5
14 {
15 
16 
17  //[-------------------------------------------------------]
18  //[ Public methods ]
19  //[-------------------------------------------------------]
21  qsf::Component(prototype),
22  mShouldBeSimulated(false),
23  mLightsEarliestOnTime(qsf::Time::fromHours(20.0f)),
24  mLightsLatestOnTime(qsf::Time::fromHours(21.0f)),
25  mLightsEarliestOffTime(qsf::Time::fromHours(7.0f)),
26  mLightsLatestOffTime(qsf::Time::fromHours(8.0f)),
27  mLightsOnTime(qsf::Time::ZERO),
28  mLightsOffTime(qsf::Time::ZERO),
29  mLightsAreOnStatus(false),
30  mLightEntityId(qsf::getUninitialized<uint64>())
31  {
32  // Noting here
33  }
34 
36  {
37  // Noting here
38  }
39 
41  {
42  return mLightsEmissiveMaterial;
43  }
44 
46  {
47  mLightsEmissiveMaterial = material;
48  }
49 
51  {
52  return mLightsEarliestOnTime;
53  }
54 
56  {
57  mLightsEarliestOnTime = time;
58  }
59 
61  {
62  return mLightsLatestOnTime;
63  }
64 
66  {
67  mLightsLatestOnTime = time;
68  }
69 
71  {
72  return mLightsEarliestOffTime;
73  }
74 
76  {
77  mLightsEarliestOffTime = time;
78  }
79 
81  {
82  return mLightsLatestOffTime;
83  }
84 
86  {
87  mLightsLatestOffTime = time;
88  }
89 
91  {
92  return mLightEntityId;
93  }
94 
96  {
97  mLightEntityId = entityId;
98  }
99 
100  inline void LightTimeControlComponent::updateLightState(const qsf::Time& currentTimeOfDay, bool forceSet)
101  {
102  // Call virtual method
103  onUpdateLightState(currentTimeOfDay, forceSet);
104  }
105 
107  {
108  return mShouldBeSimulated;
109  }
110 
111 
112 //[-------------------------------------------------------]
113 //[ Namespace ]
114 //[-------------------------------------------------------]
115 } // em5
Definition: ActionPriority.h:13
bool shouldBeSimulated() const
Return "true" if this component should receive regular state update calls from the simulation...
Definition: LightTimeControlComponent-inl.h:106
LightTimeControlComponent(qsf::Prototype *prototype)
Constructor.
Definition: LightTimeControlComponent-inl.h:20
const qsf::Time getLightsLatestOnTime() const
Return the time when the sign lights and linked lights should be latest switched on.
Definition: LightTimeControlComponent-inl.h:60
void setLightsEmissiveMaterial(const qsf::AssetProxy &material)
Set the emissive material asset to use as lights.
Definition: LightTimeControlComponent-inl.h:45
void setLightEntityId(uint64 entityId)
Set the entity ID of the linked child light to be controlled by this instance.
Definition: LightTimeControlComponent-inl.h:95
virtual void onUpdateLightState(const qsf::Time &currentTimeOfDay, bool forceSet)
virtual ~LightTimeControlComponent()
Destructor.
Definition: LightTimeControlComponent-inl.h:35
void setLightsLatestOnTime(const qsf::Time &time)
Set the time when the sign lights and linked lights should be latest switched on. ...
Definition: LightTimeControlComponent-inl.h:65
uint64_t uint64
Definition: PlatformTypes.h:184
Definition: PickupPersonByParamedicAction.h:21
void setLightsLatestOffTime(const qsf::Time &time)
Set the time when the sign lights and linked lights should be latest switched off.
Definition: LightTimeControlComponent-inl.h:85
void updateLightState(const qsf::Time &currentTimeOfDay, bool forceSet)
Update current light state depending on time-of-day.
Definition: LightTimeControlComponent-inl.h:100
const qsf::AssetProxy & getLightsEmissiveMaterial() const
Return the emissive material asset to use as lights.
Definition: LightTimeControlComponent-inl.h:40
void setLightsEarliestOnTime(const qsf::Time &time)
Set the time when the sign lights and linked lights should be earliest switched on.
Definition: LightTimeControlComponent-inl.h:55
Asset proxy class.
Definition: AssetProxy.h:57
T getUninitialized()
Definition: GetUninitialized.h:38
const qsf::Time getLightsEarliestOnTime() const
Return the time when the sign lights and linked lights should be earliest switched on...
Definition: LightTimeControlComponent-inl.h:50
void setLightsEarliestOffTime(const qsf::Time &time)
Set the time when the sign lights and linked lights should be earliest switched off.
Definition: LightTimeControlComponent-inl.h:75
Prototype class.
Definition: Prototype.h:100
const qsf::Time getLightsLatestOffTime() const
Return the time when the sign lights and linked lights should be latest switched off.
Definition: LightTimeControlComponent-inl.h:80
const qsf::Time getLightsEarliestOffTime() const
Return the time when the sign lights and linked lights should be earliest switched off...
Definition: LightTimeControlComponent-inl.h:70
uint64 getLightEntityId() const
Return the entity ID of the linked child light to be controlled by this instance. ...
Definition: LightTimeControlComponent-inl.h:90
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32