Low-Level C++ SDK  v1.3.0
Loading...
Searching...
No Matches
WeArtTemperature.h
Go to the documentation of this file.
1#pragma once
2#include "WeArtCommon.h"
3
6public:
7 WeArtTemperature() : active(false), _value(DefaultValue) {};
8
9 WeArtTemperature(bool active, float temperature) : active(active) {
10 value(temperature);
11 }
12
13 static constexpr float DefaultValue = 0.5f;
14 static constexpr float MinValue = 0.0f;
15 static constexpr float MaxValue = 1.0f;
16
17 bool active;
18
21 float value() const {
22 return _value;
23 }
24
27 void value(float temperature) {
28 _value = temperature <= MinValue ? MinValue : temperature >= MaxValue ? MaxValue : temperature;
29 }
30
31 bool operator==(const WeArtTemperature& other) const {
32 return (active == other.active && _value == other.value());
33 };
34
35private:
36 float _value;
37};
38
39
Temperature value to be applied to an effect.
Definition: WeArtTemperature.h:5
static constexpr float MinValue
Definition: WeArtTemperature.h:14
static constexpr float DefaultValue
Definition: WeArtTemperature.h:13
WeArtTemperature(bool active, float temperature)
Definition: WeArtTemperature.h:9
bool operator==(const WeArtTemperature &other) const
Definition: WeArtTemperature.h:31
static constexpr float MaxValue
Definition: WeArtTemperature.h:15
void value(float temperature)
Temperature value setter.
Definition: WeArtTemperature.h:27
float value() const
Temperature value getter.
Definition: WeArtTemperature.h:21
bool active
Definition: WeArtTemperature.h:17
WeArtTemperature()
Definition: WeArtTemperature.h:7