diff options
author | chai <chaifix@163.com> | 2018-07-28 23:28:48 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-28 23:28:48 +0800 |
commit | 7cce806948349c77a9863e6c5328d20f463f8b6c (patch) | |
tree | 464fd080715b48fa087c3aa2d58452414cf18d74 /src/libjin/Tools/Component/GameObject.h | |
parent | 178d7eea3903f41d6260777f8058a898d9107a31 (diff) |
*update
Diffstat (limited to 'src/libjin/Tools/Component/GameObject.h')
-rw-r--r-- | src/libjin/Tools/Component/GameObject.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libjin/Tools/Component/GameObject.h b/src/libjin/Tools/Component/GameObject.h new file mode 100644 index 0000000..aac9e6b --- /dev/null +++ b/src/libjin/Tools/Component/GameObject.h @@ -0,0 +1,40 @@ +#ifndef __JIN_TOOLS_GAMEOBJECT_H +#define __JIN_TOOLS_GAMEOBJECT_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT + +#include <vector> +#include "Component.h" + +namespace jin +{ +namespace tools +{ + + class GameObject + { + public: + + GameObject() + : components() + { + } + + virtual void update(float dt) + { + for each (Component* component in components) + component->update(dt); + } + + virtual void draw() = 0; + + protected: + + std::vector<Component*> components; + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT +#endif // __JIN_TOOLS_GAMEOBJECT_H
\ No newline at end of file |