00001 #ifndef GAMEOBJECTFACTORY_H_INCLUDED 00002 #define GAMEOBJECTFACTORY_H_INCLUDED 00003 00004 #include <vector> 00005 #include <string> 00006 00007 class GameObject; 00008 00009 using namespace std; 00010 00011 class GameObjectFactory{ 00012 protected: 00013 std::vector<GameObject*> gameObjects; 00014 static GameObjectFactory* instance; 00015 GameObjectFactory(); 00016 ~GameObjectFactory(); 00017 00018 00019 public: 00020 static GameObjectFactory* getInstance(){ 00021 if(!instance) 00022 instance = new GameObjectFactory; 00023 00024 return instance; 00025 }; 00026 00027 GameObject* createGameObject(); 00028 GameObject* createGameObject(const string& name); 00029 }; 00030 00031 #endif