blob: 411b4287dc2fd6abb79166e2f68f97ef335caa22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include "ControlBooleanCommand.h"
ControlBooleanCommand::ControlBooleanCommand(bool & t) : target(t) {
this->toggle = true;
}
ControlBooleanCommand::ControlBooleanCommand(bool & t, bool set) : target(t) {
this->toggle = false;
this->value = set;
}
void ControlBooleanCommand::execute() {
if (this->toggle) this->value = !this->target;
this->target = this->value;
}
|