diff options
author | Daniel Jones <admin@danieljon.es> | 2020-06-24 13:00:30 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-06-24 13:00:30 +0930 |
commit | f81202d509bebf98a986113c1b7a087cd32c43d8 (patch) | |
tree | 2c444ea686cae6b641f79807b0f3a4d4f0f6652b /Gate.cpp | |
parent | 167e63926ec8b06511bc03a897731c17e4564719 (diff) | |
download | foxlogicgates-f81202d509bebf98a986113c1b7a087cd32c43d8.tar.gz foxlogicgates-f81202d509bebf98a986113c1b7a087cd32c43d8.zip |
logic: now recursively updates gates when a change is made by keeping track of all connected gates
Diffstat (limited to 'Gate.cpp')
-rw-r--r-- | Gate.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -32,6 +32,20 @@ Gate::Gate(GATE_TYPE type, int x, int y, int width, int height) Gate::~Gate() {} +void +Gate::remove_output_gate_id(int id) +{ + int pos = 0; + for(auto g = output_gate_ids.begin(); g != output_gate_ids.end(); ++g) + { + if (id == (*g)) + { + output_gate_ids.erase(output_gate_ids.begin() + pos); + } + pos++; + } +} + void Gate::update_state() { switch (this->gate_type) @@ -116,6 +130,7 @@ void Gate::update_state() break; } } + std::string Gate::get_output_type_text() { @@ -176,7 +191,6 @@ Gate::get_output_type_text() default: return "?"; } - } |