Euphoria
sensitivity.cc
Go to the documentation of this file.
1 #include "core/sensitivity.h"
2 
3 #include "base/numeric.h"
4 
5 
6 namespace eu::core
7 {
8  Sensitivity::Sensitivity(float v, bool i)
9  : multiplier(v)
10  , inverted(i)
11  { }
12 
13 
14  bool
16  {
17  return multiplier > 0.0f;
18  }
19 
20 
21  float
23  {
24  return multiplier * get_sign(inverted);
25  }
26 }
int get_sign(float r)
Calculates the sign as a positive or a negative int.
Definition: numeric.cc:63
float get_multiplier_with_sign() const
Definition: sensitivity.cc:22
bool is_valid() const
Definition: sensitivity.cc:15
Sensitivity(float v=1.0f, bool i=false)
Definition: sensitivity.cc:8