diff options
author | Daniel Jones <admin@danieljon.es> | 2020-06-25 20:21:31 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-06-25 20:21:31 +0930 |
commit | e94e0492774134f171cded42f03ebe4e892122b0 (patch) | |
tree | 18e18fa06eead723185d6d5cebf1d06a078dfa91 /Gate.h | |
parent | c40dfb1f7e12f3d127ff8851dc3c7276840a5b81 (diff) | |
download | foxlogicgates-e94e0492774134f171cded42f03ebe4e892122b0.tar.gz foxlogicgates-e94e0492774134f171cded42f03ebe4e892122b0.zip |
functionality: implement loading xml file saved.
Diffstat (limited to 'Gate.h')
-rw-r--r-- | Gate.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |