Rise
The Vieneo Province
Condition.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Sprite.h"
4 #include "Text.h"
5 #include "../Library/Nullable.h"
6 
7 class Condition
8 {
9 public:
12 
13  std::vector<Sprite> sprites;
14  std::vector<Text> text;
15 
16  bool MeetsCondition(float busValue) const;
17 };
18 
19 inline bool Condition::MeetsCondition(float busValue) const
20 {
21  bool result = true;
22 
23  //result &= (!fault.is_set() || fault.get() == prmFault); /// @todo could do minRange maxRange out-of-range low/high
24  result &= (!min.is_set() || (busValue >= min.get()));
25  result &= (!max.is_set() || (busValue <= max.get()));
26 
27  return result;
28 }
std::vector< Text > text
Definition: Condition.h:14
std::vector< Sprite > sprites
Definition: Condition.h:13
bool MeetsCondition(float busValue) const
Definition: Condition.h:19
bool is_set() const
Definition: Nullable.h:87
Nullable< float > max
Definition: Condition.h:11
T get() const
Definition: Nullable.h:80
Nullable< float > min
Definition: Condition.h:10