summaryrefslogtreecommitdiff
path: root/Gate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Gate.cpp')
-rw-r--r--Gate.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/Gate.cpp b/Gate.cpp
index 70e55fe..89a5daa 100644
--- a/Gate.cpp
+++ b/Gate.cpp
@@ -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)