aboutsummaryrefslogtreecommitdiff
path: root/Observer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Observer.cpp')
-rw-r--r--Observer.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/Observer.cpp b/Observer.cpp
index 1e9c9bb..1d96ed4 100644
--- a/Observer.cpp
+++ b/Observer.cpp
@@ -2,22 +2,21 @@
#include <iostream>
void Observer::update(){
- std::cout << 'a' << std::endl;
+ std::cout << 'a' << std::endl;
}
-
-
void Subject::attach(Observer* obs){
- std::cout << "added" << std::endl;
- this->observers.push_back(obs);
+ std::cout << "added" << std::endl;
+ this->observers.push_back(obs);
}
void Subject::detach(Observer*){
}
-
+
// TODO possibly add foo input as update value?
void Subject::notify() {
- for (int i = 0; i < this->observers.size(); i++)
- this->observers[i]->update();
+ for (int i = 0; i < this->observers.size(); i++)
+ this->observers[i]->update();
}
+