From 7370f9ab1e76111114602b500ba9217bb7503865 Mon Sep 17 00:00:00 2001 From: sicarius Date: Sun, 4 Feb 2007 21:38:03 +0000 Subject: updated todo.txt; added some files as .pdf, too --- source/Concept/Framework/robot.h | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'source/Concept/Framework/robot.h') diff --git a/source/Concept/Framework/robot.h b/source/Concept/Framework/robot.h index 543f1ed..db7fe15 100644 --- a/source/Concept/Framework/robot.h +++ b/source/Concept/Framework/robot.h @@ -9,32 +9,29 @@ class Engine; class Robot { -public: +public: + Robot(); ~Robot(); private: - typedef hash_map moduleMap; - moduleMap modules; + IO_Module* modules[IO_END]; public: bool AddModule(IO_Module* newModule); - template T* GetModule(uint32 moduleId) - { - moduleMap::const_iterator itr = modules.find(moduleId); - if(itr == modules.end()) - return NULL; - else - return ((T*)itr->second); + template T* GetModule(uint8 moduleId) + { + return ((T*)modules[moduleId]); } - bool RemoveModule(uint32 moduleId) - { - moduleMap::iterator itr = modules.find(moduleId); - if(itr == modules.end()) - return false; - - modules.erase(itr); + bool RemoveModule(uint8 moduleId) + { + if(!modules[moduleId]) + return false; + + delete modules[moduleId]; + modules[moduleId] = NULL; + return true; } @@ -43,4 +40,4 @@ public: void Update(); }; -#endif \ No newline at end of file +#endif -- cgit v1.2.3