wavelength 1.0.0
Loading...
Searching...
No Matches
randomcondition.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 ~RandomCondition() override = default;
22
23 explicit RandomCondition(DataArray *pCondition)
24 : mLow(pCondition->Float(1)), mHigh(pCondition->Float(2)) {
25 }
26
34 bool Test() override {
35 return mLow <= TheTriggerMgr.GetRandom() && TheTriggerMgr.GetRandom() < mHigh;
36 }
37
38private:
39 float mLow;
40 float mHigh;
41};
Reference-counted array of script data nodes.
Definition dataarray.h:20
~RandomCondition() override=default
Destroy the object.
RandomCondition(DataArray *pCondition)
Definition randomcondition.h:23
bool Test() override
Test the condition.
Definition randomcondition.h:34
A test a trigger makes before its actions start.
Definition triggercondition.h:11
TriggerMgr TheTriggerMgr
The trigger registry.