-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlight.hpp
58 lines (49 loc) · 1.5 KB
/
light.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef LIGHT_HPP
#define LIGHT_HPP
#include "sensor.hpp"
/**
* @brief Light sensor class
* @details This class is used to simulate a light sensor
*/
class Light : public Sensor<bool> {
public:
/**
* @brief Construct a new Light object
* @details This constructor is used to build a light sensor
* with random values
*/
Light() {
std::cout << "Building light sensor..." << std::endl;
aleaGenVal();
};
/**
* @brief Construct a new Light object
* @details This constructor is used to build a light sensor
* with given values
* @param valSense the value of the sensor
*/
Light(bool valSense) : Sensor<bool>(valSense) {};
/**
* @brief Construct a new Light object
* @details This constructor is used to build a light sensor
* with another light sensor
* @param light a light sensor
*/
Light(const Light &light) : Sensor<bool>(light) {};
/**
* @brief Destroy the Light object
* @details This destructor is used to destroy a light sensor
*/
~Light() {};
/**
* @brief Get the value of the sensor
* @return valSense
*/
bool getValue() const;
/**
* @brief Generate a random value for the sensor
* @return the random value
*/
void aleaGenVal();
};
#endif // LIGHT_HPP