Avionics
Dropship Simulator
Condition.h
Go to the documentation of this file.
1 #include "../Nullable.h"
2 #include "Sprite.h"
3 #include "Text.h"
4 
5 class Condition
6 {
7 public:
11 
12  std::vector<Sprite> sprites;
13  std::vector<Text> text;
14 
15  bool MeetsCondition(float busValue, Systems::Fault prmFault) const
16  {
17  bool result = true;
18 
19  result &= (!fault.is_set() || fault.get() == prmFault);
20  result &= (!min.is_set() || (busValue > min.get()));
21  result &= (!max.is_set() || (busValue < max.get()));
22 
23  return result;
24  }
25 };
std::vector< Text > text
Definition: Condition.h:13
std::vector< Sprite > sprites
Definition: Condition.h:12
bool MeetsCondition(float busValue, Systems::Fault prmFault) const
Definition: Condition.h:15
bool is_set() const
Definition: Nullable.h:86
Nullable< DWORD > fault
Definition: Condition.h:10
Nullable< float > max
Definition: Condition.h:9
T get() const
Definition: Nullable.h:79
Nullable< float > min
Definition: Condition.h:8