wavelength 1.0.0
Loading...
Searching...
No Matches
timecondition.h
Go to the documentation of this file.
1#pragma once
2
4#include "game/triggermgr.h"
5#include "script/dataarray.h"
6
14public:
21 ~TimeCondition() override = default;
22
23 explicit TimeCondition(DataArray *pCondition)
24 : mLow(pCondition->Int(1)), mHigh(pCondition->Int(2)) {
25 }
26
34 bool Test() override {
35 const float flTime = TheTriggerMgr.GetTime(TheTriggerMgr.GetClock());
36 return static_cast<float>(mLow) <= flTime && flTime <= static_cast<float>(mHigh);
37 }
38
39private:
40 int mLow;
41 int mHigh;
42};
Reference-counted array of script data nodes.
Definition dataarray.h:20
bool Test() override
Test the condition.
Definition timecondition.h:34
TimeCondition(DataArray *pCondition)
Definition timecondition.h:23
~TimeCondition() override=default
Destroy the object.
A test a trigger makes before its actions start.
Definition triggercondition.h:11
TriggerMgr TheTriggerMgr
The trigger registry.