summaryrefslogtreecommitdiff
path: root/Gate.h
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2020-06-25 20:21:31 +0930
committerDaniel Jones <admin@danieljon.es>2020-06-25 20:21:31 +0930
commite94e0492774134f171cded42f03ebe4e892122b0 (patch)
tree18e18fa06eead723185d6d5cebf1d06a078dfa91 /Gate.h
parentc40dfb1f7e12f3d127ff8851dc3c7276840a5b81 (diff)
downloadfoxlogicgates-e94e0492774134f171cded42f03ebe4e892122b0.tar.gz
foxlogicgates-e94e0492774134f171cded42f03ebe4e892122b0.zip
functionality: implement loading xml file saved.
Diffstat (limited to 'Gate.h')
-rw-r--r--Gate.h7
1 files changed, 5 insertions, 2 deletions
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;