From e94e0492774134f171cded42f03ebe4e892122b0 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Thu, 25 Jun 2020 20:21:31 +0930 Subject: functionality: implement loading xml file saved. --- Gate.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Gate.h') diff --git a/Gate.h b/Gate.h index f271b97..7073aa7 100644 --- a/Gate.h +++ b/Gate.h @@ -36,7 +36,7 @@ class Gate XNOR, }; - Gate(GATE_TYPE type = INPUT, int x = 0, int y = 0, int width = 70, int height = 50); + Gate(GATE_TYPE type = INPUT, int x = 0, int y = 0, int width = 70, int height = 50, int loaded_id = -1); ~Gate(); int get_id() { return this->id; } @@ -62,7 +62,8 @@ class Gate void remove_input_gate(int id); void update_state(); - static int gate_id_counter; // used as the id of a new gate - this is NOT a count of the number of gates + static void set_id_counter(int id) { gate_id_counter = id; }; + static int get_id_counter() { return gate_id_counter; }; private: GATE_TYPE gate_type; @@ -72,6 +73,8 @@ class Gate int w; int h; + static int gate_id_counter; // used as the id of a new gate - this is NOT a count of the number of gates + /* inputs/outputs */ Gate *input_gate1; Gate *input_gate2; -- cgit v1.2.3