Let us start here, from square one. No, from Zero!

This commit is contained in:
smpn2
2022-09-30 22:45:51 +09:00
parent 14215af0d1
commit b7a60638a4
1005 changed files with 303069 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
#pragma once
#include <string>
#include <vector>
namespace rawinput {
class RawInputManager;
}
class Light {
private:
std::vector<Light> alternatives;
std::string lightName;
std::string deviceIdentifier = "";
unsigned int index = 0;
public:
float last_state = 0.f;
// overrides
bool override_enabled = false;
float override_state = 0.f;
explicit Light(std::string lightName) : lightName(std::move(lightName)) {};
std::string getDisplayString(rawinput::RawInputManager* manager);
inline std::vector<Light> &getAlternatives() {
return this->alternatives;
}
inline bool isSet() const {
if (this->override_enabled) {
return true;
}
if (!this->deviceIdentifier.empty()) {
return true;
}
for (auto &alternative : this->alternatives) {
if (!alternative.deviceIdentifier.empty()) {
return true;
}
}
return false;
}
inline const std::string &getName() const {
return this->lightName;
}
inline const std::string &getDeviceIdentifier() const {
return this->deviceIdentifier;
}
inline void setDeviceIdentifier(std::string deviceIdentifier) {
this->deviceIdentifier = std::move(deviceIdentifier);
}
inline unsigned int getIndex() const {
return this->index;
}
inline void setIndex(unsigned int index) {
this->index = index;
}
};