From d899c4fa4e8b75127471efcc35f81ce53ada27e6 Mon Sep 17 00:00:00 2001 From: andreja6 Date: Tue, 10 Apr 2018 18:02:19 -0700 Subject: [PATCH 1/9] Added base instance classes --- Instance.cpp | 9 +++++++++ Instance.h | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 Instance.cpp create mode 100644 Instance.h diff --git a/Instance.cpp b/Instance.cpp new file mode 100644 index 0000000..770db5d --- /dev/null +++ b/Instance.cpp @@ -0,0 +1,9 @@ +#include "Instance.h" + +Instance::Instance(void) +{ +} + +Instance::~Instance(void) +{ +} diff --git a/Instance.h b/Instance.h new file mode 100644 index 0000000..31719c4 --- /dev/null +++ b/Instance.h @@ -0,0 +1,8 @@ +#pragma once + +class Instance +{ +public: + Instance(void); + ~Instance(void); +}; From 0908d93f297fd429965fe2a7cb1041f5758e567e Mon Sep 17 00:00:00 2001 From: andreja6 Date: Tue, 10 Apr 2018 18:41:38 -0700 Subject: [PATCH 2/9] Added instance vector Added instance header to main --- G3DTest.vcproj | 9 +++++++++ main.cpp | 2 ++ 2 files changed, 11 insertions(+) diff --git a/G3DTest.vcproj b/G3DTest.vcproj index d4e1b2b..ba8956b 100644 --- a/G3DTest.vcproj +++ b/G3DTest.vcproj @@ -4,6 +4,7 @@ Version="8.00" Name="G3DTest" ProjectGUID="{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}" + RootNamespace="G3DTest" > + + @@ -233,6 +238,10 @@ Name="Header Files" Filter="h;hpp;hxx;hm;inl" > + + +#include "Instance.h" #if G3D_VER < 61000 #error Requires G3D 6.10 #endif static const float VNUM = 0.01F; static const std::string VERSION = "PRE-ALPHA "; +static std::vector Instances; static GFontRef fntdominant = NULL; static GFontRef fntlighttrek = NULL; static bool democ = true; From 59f66523960c1d1a68737aaf322583e1163e3f31 Mon Sep 17 00:00:00 2001 From: andreja6 Date: Tue, 10 Apr 2018 21:59:55 -0700 Subject: [PATCH 3/9] Added instance types I feel like the way it works now isn't the best --- G3DTest.suo | Bin 10240 -> 12288 bytes G3DTest.vcproj | 8 ++++++++ Instance.cpp | 16 ++++++++++++++++ Instance.h | 5 +++++ PhysicalInstance.cpp | 26 ++++++++++++++++++++++++++ PhysicalInstance.h | 10 ++++++++++ main.cpp | 10 +++++++++- 7 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 PhysicalInstance.cpp create mode 100644 PhysicalInstance.h diff --git a/G3DTest.suo b/G3DTest.suo index b97defc4fe6fcbc8c11d5c731d0172350351671c..2ee9c137b479be7e7898b161d9eb9f8a548df7f0 100644 GIT binary patch delta 1778 zcma)+?{8C87{|}OyS=^bx~=Ov*0HjVmAZu?4%`O*K+9k-bXi*+!X{`JAPloil+J8Z zScgiCykUL(127>WVK2Zm@im4S4T*`1iM}yLU->hdMG_e?tKaXvw+4k6pXSr^obNs7 zp68tVJSU&dXRmG7*N2r-K~M`qpbpf7)l#XnhV2KL%UZ!0&?2&Av{YUFc|NuDg;s$l z$%xDtH?0P^7+aDH@%DnxkSWiA*#xa#$+fnPk`Eek+cRbyfFwuF$BjdDE}7%TVLD-N zdtVw(25`w|(GI!(b8dSO?JyVt&$}AOz5xG4kfk=CnGL@3-pF^muJom@6e@>vy$3ra zV|5mjmZ4jWw;ZJ8{3*F%Y?14T_O^dO7L88HRi;e?gM3cZw<^=JI|4b7@@f`zzpDq* zripH~yScDYoT@rd@#wfQtogabgs!weXElZ>rB&p&A71s@zVmmtZ!1Af()9zfzjmZ% zpPEpoR8EbeJ)(}uhqb+h(3HNQ%S`Bu)+H;Un_d;gtdPBScmv$C&TEzGQQhhhwY3m# z?5|V*8H}kAq2|o1Lem01Tj&b?w)$&{`cvqSf(prm8;bdGzoF~)f@T7$p~;=dKG_x7 zA^FC$4gKmE1|P-$t9a2KbwZ89KP4-T$2D(pZtV@t^kP=PIjvmuExlcrJJCVi<0|Vu zmqkC0xf#dI@3Yp?Z#COr$n3-9DI7qw6$h|n#3dQC^cs7NCxvGhiz_jYp{1o1UzTs; z{-%E&qS~y+Fw6snW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k&?x zY{!K-T!6gDU;znn7M>HEp>vvzXjTn>QL`(WRl%n;OKVn5%MIR%Js6Ga8GbzO%8xOn z*>lZ!n=dqbsTr?6uh~1zxc&>o-_2LeTH%)8GrsF@ z5Zfuu_~RVn0@$!-TM& + + + + #include "Instance.h" +std::string name; +Instance* parent; +static const int BASE_INSTANCE = 0; +static const int PHYSICAL_INSTANCE = 1; +static const int type = BASE_INSTANCE; + Instance::Instance(void) { + name = "Default Game Instance"; } Instance::~Instance(void) { + name = "Default Game Instance"; } +int getType() +{ + return type; +} + + + diff --git a/Instance.h b/Instance.h index 31719c4..ca35656 100644 --- a/Instance.h +++ b/Instance.h @@ -5,4 +5,9 @@ class Instance public: Instance(void); ~Instance(void); + std::string name; + int getType(); + Instance* parent; // Another pointer. + static const int BASE_INSTANCE; + static const int PHYSICAL_INSTANCE; }; diff --git a/PhysicalInstance.cpp b/PhysicalInstance.cpp new file mode 100644 index 0000000..4e21366 --- /dev/null +++ b/PhysicalInstance.cpp @@ -0,0 +1,26 @@ +#include +#include "PhysicalInstance.h" + + +bool collides = true; +bool anchored = false; +Vector3 size; +Vector3 position; +Color3 color; +//static const int type = PHYSICAL_INSTANCE; + +PhysicalInstance::PhysicalInstance(void) +{ + name = "Default PhysicalInstance"; + collides = true; + anchored = true; + size = Vector3(2,1,4); + position = Vector3(0,0,0); + color = Color3::gray(); +} + +PhysicalInstance::~PhysicalInstance(void) +{ +} + + diff --git a/PhysicalInstance.h b/PhysicalInstance.h new file mode 100644 index 0000000..7cdde93 --- /dev/null +++ b/PhysicalInstance.h @@ -0,0 +1,10 @@ +#pragma once +#include "instance.h" + +class PhysicalInstance : + public Instance +{ +public: + PhysicalInstance(void); + ~PhysicalInstance(void); +}; diff --git a/main.cpp b/main.cpp index 3a651eb..edf9e7b 100644 --- a/main.cpp +++ b/main.cpp @@ -12,6 +12,7 @@ */ #include #include "Instance.h" +#include "PhysicalInstance.h" #if G3D_VER < 61000 #error Requires G3D 6.10 @@ -19,6 +20,7 @@ static const float VNUM = 0.01F; static const std::string VERSION = "PRE-ALPHA "; static std::vector Instances; +static Instance* dataModel; static GFontRef fntdominant = NULL; static GFontRef fntlighttrek = NULL; static bool democ = true; @@ -93,11 +95,17 @@ std::string Convert (float number){ void Demo::onInit() { // Called before Demo::run() beings + dataModel = new Instance(); + //dataModel->name = "undefined"; + dataModel->parent = NULL; + + PhysicalInstance* test = new PhysicalInstance(); setDesiredFrameRate(FPSVal[index]); app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); //std::string str = "Dynamica Duomillenium 5 Version " + VERSION + Convert(VNUM); - std::string str = "Game \"undefined\""; + std::string str = "Game \"" + dataModel->name + "\""; + app->renderDevice->setCaption(str); GApplet::onInit(); } From 2b508cd01744c4003b948216235cce3a9df69a19 Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 11 Apr 2018 06:42:11 -0700 Subject: [PATCH 4/9] Changed the way of getting an instance type --- G3DTest.suo | Bin 12288 -> 13312 bytes Instance.cpp | 9 ++------- Instance.h | 1 + PhysicalInstance.cpp | 8 ++++---- main.cpp | 2 +- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/G3DTest.suo b/G3DTest.suo index 2ee9c137b479be7e7898b161d9eb9f8a548df7f0..7fdd41e53e811522b77a9f439035f13ed69ddc9e 100644 GIT binary patch delta 1812 zcmai!T})g>6vt=o-g~(V3tg7aUA|e??!p$^fVDMgppj^*BHM_|3!_JHB9Q%co?)%>VYW>oZl(D(bywXd}gl4{ORnGa~E5$+mH-iXE}8#LuN zYr;GUQPTF$vl%!Cz(H^b90sFc6*C@1dlZa-=fGp&aWDp+0LQ>_kOt%6N$?by08fKw zz_Z{4;Ckfw+x$~X+3E!fi+iKzoB_iLqJu$&y=F?kGIWXj5x-M1Wy9K$wRo3gBlv)_ zl=i#5OkhYZl<&%w4_KU5K{1~xAM=IA4W-{qmtj4nv@g43a8zyun~Z>#RLw(@NFI{Z zmXJ=%#mak3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Zf-jb(RS41SjSXt8(pG>thvK@A47WxJRYYW``4`;bfA13 zIsu)8n6XYHJ_B_zn+lK2I9eKU+1TWHWTEE{Ou zvtSp67~|n4t_nnBJOxIJ{+jT=ZJfd`&|4-3rNNaz&!-zaUp79+nYSW83-N)H9AUy@ zL)lNPPRS=>OB~i4vT`1NzD7#V)5{9)OhJpZAr~%lTBI;! zb0f>-%vOy^kF6IjNV~aKexmheG~%~f9JI?k49PGD2NB(htryQ*DO#)3QoxP2y!#Nv z%V%j!57A()pPDP%Mm{;dy+uK&<8x>lzi4JzPzJ=!c{j{7i1$+h)j-K{^@!QFL(Ed3 zEfCv2h?x`G4_TnF5F;kcL2?9QI|}i@GUyn@b_z-^(rFSQ`V{lQUr?-Hv0V5|id|7G z8~&ixz z;`PM`h#{*C4;Op|e3BhNz`O5KtP1fe#MZ4Cf0`bi0E;NbufAWg%ZjCf4JtMSU&%4c zz@r5I8a(I4(6EXp=w4N~7Fp~2Mej=scX&~?{l1e#{j~YmTfbzm~=~jc)@R|M_?Hoz5;ZOE%$~%f^c(+M20_as!Rg>K5}?D>DCw zNOil+GJgTSMi*(+x0n2ygC6;sXwuh!IKzzFa&_ttJfm^nZd%bibThMz(sc*Ds_mt* Rf #include "PhysicalInstance.h" - -bool collides = true; +static const std::string className = "Part"; +bool canCollide = true; bool anchored = false; Vector3 size; Vector3 position; Color3 color; -//static const int type = PHYSICAL_INSTANCE; PhysicalInstance::PhysicalInstance(void) { name = "Default PhysicalInstance"; - collides = true; + canCollide = true; anchored = true; size = Vector3(2,1,4); position = Vector3(0,0,0); color = Color3::gray(); + } PhysicalInstance::~PhysicalInstance(void) diff --git a/main.cpp b/main.cpp index edf9e7b..b547d73 100644 --- a/main.cpp +++ b/main.cpp @@ -99,7 +99,7 @@ void Demo::onInit() { //dataModel->name = "undefined"; dataModel->parent = NULL; - PhysicalInstance* test = new PhysicalInstance(); + Instance* test = new PhysicalInstance(); setDesiredFrameRate(FPSVal[index]); app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); From 7d385231660fcb06d41d1b45d7244a3b6a1202cd Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 11 Apr 2018 07:20:43 -0700 Subject: [PATCH 5/9] Changed how instances work Made instance vector hold pointers Made all instances delete on exit Made error message delete all instances --- main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index b547d73..f53896d 100644 --- a/main.cpp +++ b/main.cpp @@ -19,7 +19,7 @@ #endif static const float VNUM = 0.01F; static const std::string VERSION = "PRE-ALPHA "; -static std::vector Instances; +static std::vector instances; static Instance* dataModel; static GFontRef fntdominant = NULL; static GFontRef fntlighttrek = NULL; @@ -109,20 +109,26 @@ void Demo::onInit() { app->renderDevice->setCaption(str); GApplet::onInit(); } - +void clearInstances() +{ + for(size_t i = 0; i < instances.size(); i++) + delete instances.at(i); + delete dataModel; +} void OnError(int err, std::string msg = "") { std::string emsg = "An unexpected error has occured and DUOM 5 has to quit. We're sorry!" + msg; + clearInstances(); MessageBox(NULL, emsg.c_str(),"Dynamica Crash", MB_OK); exit(err); } void Demo::onCleanup() { - // Called when Demo::run() exits - + clearInstances(); } + void Demo::onLogic() { // Add non-simulation game logic and AI code here } From 58ee5c98893213d8f03bbc5e5fd72e9a4a04035c Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 11 Apr 2018 08:56:54 -0700 Subject: [PATCH 6/9] Added instance rendering Added rendering and creation --- Instance.cpp | 3 ++- Instance.h | 5 +---- PhysicalInstance.cpp | 7 +++++-- PhysicalInstance.h | 5 +++++ main.cpp | 36 +++++++++++++++++++++++++++++++----- 5 files changed, 44 insertions(+), 12 deletions(-) diff --git a/Instance.cpp b/Instance.cpp index dffef1a..f28c8e5 100644 --- a/Instance.cpp +++ b/Instance.cpp @@ -3,11 +3,12 @@ std::string name; Instance* parent; -static const std::string className = "Instance"; +static std::string className = "Instance"; Instance::Instance(void) { name = "Default Game Instance"; + className = "Part"; } Instance::~Instance(void) diff --git a/Instance.h b/Instance.h index 2426db2..26cfbce 100644 --- a/Instance.h +++ b/Instance.h @@ -6,9 +6,6 @@ public: Instance(void); ~Instance(void); std::string name; - int getType(); Instance* parent; // Another pointer. - static const int BASE_INSTANCE; - static const int PHYSICAL_INSTANCE; - static int type; + std::string className; }; diff --git a/PhysicalInstance.cpp b/PhysicalInstance.cpp index 68001da..e08b6e5 100644 --- a/PhysicalInstance.cpp +++ b/PhysicalInstance.cpp @@ -1,22 +1,25 @@ #include #include "PhysicalInstance.h" -static const std::string className = "Part"; bool canCollide = true; bool anchored = false; Vector3 size; Vector3 position; +Vector3 velocity; +Vector3 rotVelocity; Color3 color; PhysicalInstance::PhysicalInstance(void) { name = "Default PhysicalInstance"; + className = "Part"; canCollide = true; anchored = true; size = Vector3(2,1,4); position = Vector3(0,0,0); color = Color3::gray(); - + velocity = Vector3(0,0,0); + rotVelocity = Vector3(0,0,0); } PhysicalInstance::~PhysicalInstance(void) diff --git a/PhysicalInstance.h b/PhysicalInstance.h index 7cdde93..f063a51 100644 --- a/PhysicalInstance.h +++ b/PhysicalInstance.h @@ -7,4 +7,9 @@ class PhysicalInstance : public: PhysicalInstance(void); ~PhysicalInstance(void); + Vector3 size; + Vector3 position; + Vector3 velocity; + Vector3 rotvelocity; + Color3 color; }; diff --git a/main.cpp b/main.cpp index f53896d..59c4097 100644 --- a/main.cpp +++ b/main.cpp @@ -92,6 +92,14 @@ std::string Convert (float number){ return buff.str(); } + +PhysicalInstance* makePart() +{ + PhysicalInstance* part = new PhysicalInstance(); + instances.push_back(part); + return part; +} + void Demo::onInit() { // Called before Demo::run() beings @@ -99,7 +107,11 @@ void Demo::onInit() { //dataModel->name = "undefined"; dataModel->parent = NULL; - Instance* test = new PhysicalInstance(); + PhysicalInstance* test = makePart(); + test->parent = dataModel; + test->color = Color3(0.2,0.7,0.3); + test->size = Vector3(128,1,128); + setDesiredFrameRate(FPSVal[index]); app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); @@ -109,6 +121,9 @@ void Demo::onInit() { app->renderDevice->setCaption(str); GApplet::onInit(); } + + + void clearInstances() { for(size_t i = 0; i < instances.size(); i++) @@ -260,16 +275,27 @@ void Demo::onGraphics(RenderDevice* rd) { Draw::axes(CoordinateFrame(Vector3(0, 0, 0)), app->renderDevice); - makeFlag(Vector3(1, 0.5, 0.5), rd); + //makeFlag(Vector3(1, 0.5, 0.5), rd); app->renderDevice->setLight(0, GLight::directional(lighting.lightDirection, lighting.lightColor)); app->renderDevice->setAmbientLightColor(lighting.ambient); - Draw::box(G3D::Box(Vector3(4.0/2,1.0/2,2.0/2),Vector3(0,0,0)), rd, Color3::gray(), Color4(0,0,0,0)); - - Draw::cylinder(G3D::Cylinder::Cylinder(Vector3(0,5,0),Vector3(0,10,0),1),app->renderDevice,Color4(0,0,1,0.5),Color4(0,0,0,0)); + //Draw::box(G3D::Box(Vector3(4.0/2,1.0/2,2.0/2),Vector3(0,0,0)), rd, Color3::gray(), Color4(0,0,0,0)); + for(size_t i = 0; i < instances.size(); i++) + { + Instance* instance = instances.at(i); + if(instance->className == "Part" && instance->parent != NULL) + { + PhysicalInstance* part = (PhysicalInstance*)instance; + Vector3 size = part->size; + Vector3 pos = part->position; + Draw::box(Box(Vector3((pos.x-size.x/2)/2,(pos.y-size.y/2)/2,(pos.z-size.z/2)/2),Vector3((pos.x+size.x/2)/2,(pos.y+size.y/2)/2,(pos.z+size.z/2)/2)), app->renderDevice, part->color, Color4::clear()); + } + + } + //Draw::cylinder(G3D::Cylinder::Cylinder(Vector3(0,5,0),Vector3(0,10,0),1),app->renderDevice,Color4(0,0,1,0.5),Color4(0,0,0,0)); From 2a205e2998c99340b02dbe5060b3c566d97789ba Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 11 Apr 2018 09:13:48 -0700 Subject: [PATCH 7/9] Made title of window dynamic --- main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 59c4097..423b84b 100644 --- a/main.cpp +++ b/main.cpp @@ -18,6 +18,7 @@ #error Requires G3D 6.10 #endif static const float VNUM = 0.01F; +static std::string title = ""; static const std::string VERSION = "PRE-ALPHA "; static std::vector instances; static Instance* dataModel; @@ -116,9 +117,10 @@ void Demo::onInit() { app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); //std::string str = "Dynamica Duomillenium 5 Version " + VERSION + Convert(VNUM); - std::string str = "Game \"" + dataModel->name + "\""; + //title = dataModel->name; + + - app->renderDevice->setCaption(str); GApplet::onInit(); } @@ -155,7 +157,11 @@ void Demo::onNetwork() { void Demo::onSimulation(RealTime rdt, SimTime sdt, SimTime idt) { - + if(dataModel->name != title) + { + title = dataModel->name; + app->renderDevice->setCaption("Game \"" + title + "\""); + } } From e348ee5ea26aed97702a4c4941ec419e6a837d6f Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 11 Apr 2018 09:43:42 -0700 Subject: [PATCH 8/9] Added test object --- main.cpp | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 423b84b..dc786a4 100644 --- a/main.cpp +++ b/main.cpp @@ -110,9 +110,77 @@ void Demo::onInit() { PhysicalInstance* test = makePart(); test->parent = dataModel; - test->color = Color3(0.2,0.7,0.3); - test->size = Vector3(128,1,128); + test->color = Color3(0.2F,0.3F,1); + test->size = Vector3(24,1,24); + + test = makePart(); + test->parent = dataModel; + test->color = Color3(.5F,1,.5F); + test->size = Vector3(4,1,2); + test->position = Vector3(10,1,0); + test = makePart(); + test->parent = dataModel; + test->color = Color3(.5F,1,.5F); + test->size = Vector3(4,1,2); + test->position = Vector3(-10,1,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(-7,2,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(7,2,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(-4,3,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(5,3,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(-1,4,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(3,4,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(2,5,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(0,6,0); + + test = makePart(); + test->parent = dataModel; + test->color = Color3::gray(); + test->size = Vector3(4,1,2); + test->position = Vector3(-2,7,0); + + + setDesiredFrameRate(FPSVal[index]); app->debugCamera.setPosition(Vector3(0, 2, 10)); app->debugCamera.lookAt(Vector3(0, 2, 0)); From 4769e4f331f66602bdd9367f70547538a0fef64b Mon Sep 17 00:00:00 2001 From: andreja6 Date: Wed, 11 Apr 2018 10:17:26 -0700 Subject: [PATCH 9/9] Converted to CLR to allow for forms --- G3DTest.suo | Bin 13312 -> 14336 bytes G3DTest.vcproj | 24 ++++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/G3DTest.suo b/G3DTest.suo index 7fdd41e53e811522b77a9f439035f13ed69ddc9e..e46d4b1455d16b52883229c3a4fcf97b7a9be106 100644 GIT binary patch delta 717 zcmZ9J&r4KM6vxliduN`OGow@1qCMOKA}t4hTdk=$poA#QD6xg z=ias})%`TKrz*pJdp%(pmU_w0VTsDwph>y2RT$$D6gCQB2Cgmny0fgL38+_&F`06I7spRRJv9EoOoh~E2g0B zz4IfmR^qf`55uaF@Ju zk%ogV5Z$19T>2xih;snQ;K4|f^&JQDQA3d?HMKx&7^~{#MYoH8>PGf#TV0M;*%gz1 XR~5f-`#7)TyyfY?*0SN~O$xFbuPBD5z5 zau{rO;Ar7y6$Yvln#^ykz4?pq1y&9@B;z)Jkvz{b`7n#&bjXDQS?($tCjs zAmPnl + + + + +