diff options
author | Daniel Jones <admin@danieljon.es> | 2020-07-07 11:13:11 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-07-07 11:13:11 +0930 |
commit | 848e32a6983cd2d61e3c1e9a489ca6563536099f (patch) | |
tree | 5bb734dce7da0c30fd538ee49d19ced5c76ae091 /MainWindow.cpp | |
parent | 32f7cf863c1b430872c3b7ae4be49fbedede63ad (diff) | |
download | foxlogicgates-848e32a6983cd2d61e3c1e9a489ca6563536099f.tar.gz foxlogicgates-848e32a6983cd2d61e3c1e9a489ca6563536099f.zip |
make update_state pure virtual, use Object instead of gate
Diffstat (limited to 'MainWindow.cpp')
-rw-r--r-- | MainWindow.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/MainWindow.cpp b/MainWindow.cpp index 19012ec..9de495a 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -507,11 +507,12 @@ void MainWindow::update_object_state(Object *object) { object->update_state(); - /* update all gates that are using this gate as an input */ - Gate *object2; - for(auto o = object->get_output_objects()->begin(); o != object->get_output_objects()->end(); ++o) + /* update all objects that are using this object as an input */ + Object *object2; + auto output_objects = object->get_output_objects(); + for(auto o = output_objects->begin(); o != output_objects->end(); ++o) { - object2 = (Gate*)find_object_by_id((*o)); + object2 = find_object_by_id((*o)); if (object2) { update_object_state(object2); @@ -519,6 +520,7 @@ MainWindow::update_object_state(Object *object) } } + void MainWindow::find_selected_input(int x, int y) { |