From 1e7b871722482f7f77e2ab3c80dd5bec1596d29c Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Fri, 3 Jul 2020 22:18:55 +0930 Subject: Functionality: saving/loading with binary displays added --- BinaryDisplay.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'BinaryDisplay.cpp') diff --git a/BinaryDisplay.cpp b/BinaryDisplay.cpp index 4b51703..2786fe7 100644 --- a/BinaryDisplay.cpp +++ b/BinaryDisplay.cpp @@ -1,7 +1,12 @@ #include "BinaryDisplay.h" -BinaryDisplay::BinaryDisplay(int x_, int y_, int width, int height) +BinaryDisplay::BinaryDisplay(int x_, int y_, int width, int height, int loaded_id) { + /* special handing of id - if the object is loaded from file the loaded_id will be set and we use that */ + if (loaded_id != -1) + id = loaded_id; + else + id = Object::object_id_counter++; // increment counter after assigning x = x_; y = y_; w = width; -- cgit v1.2.3