summaryrefslogtreecommitdiff
path: root/Object.h
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2020-07-01 19:31:11 +0930
committerDaniel Jones <admin@danieljon.es>2020-07-01 19:31:11 +0930
commit010b96610730b5028c42faa633d067ebb411a744 (patch)
treeb18659d0e83128d636078daa7df28867783cdefa /Object.h
parentec91ec4eede7ea2a2a42261a3b0d8d0eb7b2397b (diff)
downloadfoxlogicgates-010b96610730b5028c42faa633d067ebb411a744.tar.gz
foxlogicgates-010b96610730b5028c42faa633d067ebb411a744.zip
move remove_input_object() into object superclass
Diffstat (limited to 'Object.h')
-rw-r--r--Object.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/Object.h b/Object.h
index 2d2f175..10184dc 100644
--- a/Object.h
+++ b/Object.h
@@ -38,6 +38,13 @@ class Object
BINARYDISPLAY,
};
+ struct selected_input_object
+ {
+ Object *object;
+ int input;
+ };
+
+
virtual ~Object() = default;
int get_id() { return this->id; };
int get_x() { return this->x; };
@@ -47,11 +54,11 @@ class Object
void set_x(int x) { this->x = x; };
void set_y(int y) { this->y = y; };
- void add_output_object_id(int id) { this->output_object_ids.push_back(id); };
+ void add_output_object_id(int id_) { this->output_object_ids.push_back(id_); };
virtual void update_state() {}; // subclasses must implement
- static void set_object_id_counter(int id) { object_id_counter = id; };
+ static void set_object_id_counter(int id_) { object_id_counter = id_; };
static int get_object_id_counter() { return object_id_counter; };
OBJECT_TYPE get_object_type() { return object_type; };
@@ -60,12 +67,12 @@ class Object
std::vector<int> *get_output_objects() { return &this->output_object_ids; };
- void remove_output_object_id(int id)
+ void remove_output_object_id(int id_)
{
int pos = 0;
for(auto o = output_object_ids.begin(); o != output_object_ids.end(); ++o)
{
- if (id == (*o))
+ if (id_ == (*o))
{
output_object_ids.erase(output_object_ids.begin() + pos);
break;
@@ -77,6 +84,8 @@ class Object
bool get_output_state() { return this->output_state; };
void set_state(bool state) { this->output_state = state; };
+ virtual void remove_input_object(int id_) { printf("remove_input_object not implemented\n"); };
+
protected:
int id;
int x;