diff options
author | Daniel Jones <admin@danieljon.es> | 2020-06-24 21:24:22 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-06-24 21:24:22 +0930 |
commit | 91aff1783d364f3f2c814a90ec292cb89d5deb88 (patch) | |
tree | 464d2c2adcf8977c1e3a355783194a50fca7d136 /Gate.cpp | |
parent | 19c61272bde25dbf1991bcb3ad31d173cda92df2 (diff) | |
download | foxlogicgates-91aff1783d364f3f2c814a90ec292cb89d5deb88.tar.gz foxlogicgates-91aff1783d364f3f2c814a90ec292cb89d5deb88.zip |
functionality: implemented deleting selected gate with the delete key.
Diffstat (limited to 'Gate.cpp')
-rw-r--r-- | Gate.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -40,7 +40,6 @@ Gate::remove_output_gate_id(int id) { if (id == (*g)) { - printf("%id = %d\n", id, *g); output_gate_ids.erase(output_gate_ids.begin() + pos); break; } @@ -48,6 +47,22 @@ Gate::remove_output_gate_id(int id) } } +void +Gate::remove_input_gate(int id) +{ + if (input_gate1) + { + if (input_gate1->get_id() == id) + input_gate1 = nullptr; + } + + if (input_gate2) + { + if (input_gate2->get_id() == id) + input_gate2 = nullptr; + } +} + void Gate::update_state() { switch (this->gate_type) |