From 83e46713e132a0a9a1b5ded9e1a102eb460e76b7 Mon Sep 17 00:00:00 2001 From: Hello_User Date: Thu, 4 May 2023 09:22:06 +0200 Subject: [PATCH] Opdracht 2 3n 3 final Co-authored-by: Aryan Lala (19097727) --- Opdracht_2/AnalogeMeter.cpp | 2 +- Opdracht_2/Observer.cpp | 2 +- Opdracht_3/Opdracht_3_Alt/main | Bin 0 -> 49632 bytes Opdracht_3/Opdracht_3_Alt/main.cpp | 9 +- Opdracht_3/Opdracht_3_Alt/opdracht3.drawio | 157 +++++---------------- 5 files changed, 37 insertions(+), 133 deletions(-) create mode 100755 Opdracht_3/Opdracht_3_Alt/main diff --git a/Opdracht_2/AnalogeMeter.cpp b/Opdracht_2/AnalogeMeter.cpp index f865630..a38c3e8 100644 --- a/Opdracht_2/AnalogeMeter.cpp +++ b/Opdracht_2/AnalogeMeter.cpp @@ -10,5 +10,5 @@ AnalogeMeter::AnalogeMeter(Snelheid* s):Observer(s){ void AnalogeMeter::update() { - cout << "Analoog: " << dynamic_cast(getSubject())->geef(); + cout << "Analoog: " << dynamic_cast(getSubject())->geef() << endl; } \ No newline at end of file diff --git a/Opdracht_2/Observer.cpp b/Opdracht_2/Observer.cpp index eb440a8..6bf0f51 100644 --- a/Opdracht_2/Observer.cpp +++ b/Opdracht_2/Observer.cpp @@ -1,4 +1,4 @@ -#include "observer.h" +#include "Observer.h" void Subject::notify ( ){ for ( list::iterator i=L.begin( ); i!=L.end( ); ++i ) (*i)->update( ); diff --git a/Opdracht_3/Opdracht_3_Alt/main b/Opdracht_3/Opdracht_3_Alt/main new file mode 100755 index 0000000000000000000000000000000000000000..9ef87b603eb271d04073ffef0da3b20e36a27b13 GIT binary patch literal 49632 zcmeHw4}4rzmH$i9l(a${${#~PoYn%RK*%I%nxeuq&7>3hFJ{tOSm1RsGi?SYGht?u zrr=_w1r4QcWEELNw(GLk<%iPs4^~7Bet(@D!O3k%Y&zJ&M-988WN;(x#W{e z1*>MMtcFIV%2T;=y7bTolE=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^)`}EZu(n9?Z+@6_?X~K83bE&z1UXER4F) z<)s@es;*zdg}5NwZV`^ETYP-w3n|1irzt4mY{K{>IgTO11*#~pB8{G;ARhZS=vi=W rHyyv|d3dYsij_YrKC3b<^K3|5YP~h~cw7`JziN--Snep`$Qu6*Nl(WN literal 0 HcmV?d00001 diff --git a/Opdracht_3/Opdracht_3_Alt/main.cpp b/Opdracht_3/Opdracht_3_Alt/main.cpp index 3d724d0..54fb537 100644 --- a/Opdracht_3/Opdracht_3_Alt/main.cpp +++ b/Opdracht_3/Opdracht_3_Alt/main.cpp @@ -49,7 +49,6 @@ Observer::~Observer (){ class Element{ public: virtual ~Element () {} - virtual int draw () = 0; virtual string name () = 0; }; @@ -57,12 +56,12 @@ class Ninja : public Element, public Subject{ private: string Name; int AantalLevens; public: Ninja (string n) : Name(n), AantalLevens(1) { } - virtual int draw () { return AantalLevens; } virtual string name () { return Name; } virtual int aantalLevens () { return AantalLevens; } virtual void incLevens () { AantalLevens++; notify(); } virtual void decLevens () { AantalLevens--; notify(); } }; + // ================================================================ // Interfacelayer // ================================================================ @@ -70,8 +69,7 @@ class NinjaWindow : public Observer{ private: Ninja* N; public: NinjaWindow (Ninja* n) : Observer(n) {} virtual ~NinjaWindow () {} - //virtual void draw() { cout << N.name() << N.draw() << endl; } - virtual void update() {cout << dynamic_cast(getSubject())->name() << dynamic_cast(getSubject())->draw();} + virtual void update() {cout << dynamic_cast(getSubject())->name() << dynamic_cast(getSubject())->aantalLevens() << endl;} }; int main( ){ @@ -84,5 +82,4 @@ int main( ){ j.incLevens(); h.incLevens(); return 0; -} -// ================================================================ \ No newline at end of file +} \ No newline at end of file diff --git a/Opdracht_3/Opdracht_3_Alt/opdracht3.drawio b/Opdracht_3/Opdracht_3_Alt/opdracht3.drawio index c45161d..c1c42e9 100644 --- a/Opdracht_3/Opdracht_3_Alt/opdracht3.drawio +++ b/Opdracht_3/Opdracht_3_Alt/opdracht3.drawio @@ -1,6 +1,6 @@ - + @@ -11,10 +11,10 @@ - + - + @@ -27,58 +27,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -99,7 +47,7 @@ - + @@ -110,57 +58,13 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -174,7 +78,7 @@ - + @@ -229,31 +133,25 @@ - - + + - + - + - + - + - - - - - - @@ -278,45 +176,54 @@ - + - + - + - + - + - + - + - + - + + + + + + + + + +