From 89e7a9ecfad9a54633eb3ebbab1d1f13ad78826f Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 6 Aug 2018 16:22:00 +0800 Subject: *update --- src/libjin/Utils/CSV/CSV.cpp | 0 src/libjin/Utils/CSV/CSV.h | 1 + src/libjin/Utils/Component/Component.h | 30 ++++++++++++++++++ src/libjin/Utils/Component/GameObject.h | 40 ++++++++++++++++++++++++ src/libjin/Utils/EventMsgCenter/EventMsgCenter.h | 20 ++++++++++++ src/libjin/Utils/EventMsgCenter/Events.h | 20 ++++++++++++ src/libjin/Utils/Json/Json.cpp | 0 src/libjin/Utils/Json/Json.h | 1 + src/libjin/Utils/XML/XML.cpp | 0 src/libjin/Utils/XML/XML.h | 1 + 10 files changed, 113 insertions(+) create mode 100644 src/libjin/Utils/CSV/CSV.cpp create mode 100644 src/libjin/Utils/CSV/CSV.h create mode 100644 src/libjin/Utils/Component/Component.h create mode 100644 src/libjin/Utils/Component/GameObject.h create mode 100644 src/libjin/Utils/EventMsgCenter/EventMsgCenter.h create mode 100644 src/libjin/Utils/EventMsgCenter/Events.h create mode 100644 src/libjin/Utils/Json/Json.cpp create mode 100644 src/libjin/Utils/Json/Json.h create mode 100644 src/libjin/Utils/XML/XML.cpp create mode 100644 src/libjin/Utils/XML/XML.h (limited to 'src/libjin/Utils') diff --git a/src/libjin/Utils/CSV/CSV.cpp b/src/libjin/Utils/CSV/CSV.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/libjin/Utils/CSV/CSV.h b/src/libjin/Utils/CSV/CSV.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/src/libjin/Utils/CSV/CSV.h @@ -0,0 +1 @@ +#pragma once diff --git a/src/libjin/Utils/Component/Component.h b/src/libjin/Utils/Component/Component.h new file mode 100644 index 0000000..f63fb59 --- /dev/null +++ b/src/libjin/Utils/Component/Component.h @@ -0,0 +1,30 @@ +#ifndef __JIN_TOOLS_COMPONENT_H +#define __JIN_TOOLS_COMPONENT_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT + +namespace jin +{ +namespace utils +{ + + class GameObject; + + class Component + { + public: + Component(GameObject* obj) + : gameObject(obj) + {} + + virtual void update(float dt) = 0; + + private: + GameObject* gameObject; + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT +#endif // __JIN_TOOLS_COMPONENT_H \ No newline at end of file diff --git a/src/libjin/Utils/Component/GameObject.h b/src/libjin/Utils/Component/GameObject.h new file mode 100644 index 0000000..e4f3aa5 --- /dev/null +++ b/src/libjin/Utils/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 +#include "Component.h" + +namespace jin +{ +namespace utils +{ + + 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 components; + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_COMPONENT +#endif // __JIN_TOOLS_GAMEOBJECT_H \ No newline at end of file diff --git a/src/libjin/Utils/EventMsgCenter/EventMsgCenter.h b/src/libjin/Utils/EventMsgCenter/EventMsgCenter.h new file mode 100644 index 0000000..6717b83 --- /dev/null +++ b/src/libjin/Utils/EventMsgCenter/EventMsgCenter.h @@ -0,0 +1,20 @@ +#ifndef __JIN_TOOLS_EVENTMSGCENTER_H +#define __JIN_TOOLS_EVENTMSGCENTER_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER + +namespace jin +{ +namespace utils +{ + + class EventMSGCenter + { + + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER +#endif // __JIN_TOOLS_EVENTMSGCENTER_H \ No newline at end of file diff --git a/src/libjin/Utils/EventMsgCenter/Events.h b/src/libjin/Utils/EventMsgCenter/Events.h new file mode 100644 index 0000000..9ebc30d --- /dev/null +++ b/src/libjin/Utils/EventMsgCenter/Events.h @@ -0,0 +1,20 @@ +#ifndef __JIN_TOOLS_EVENTS_H +#define __JIN_TOOLS_EVENTS_H +#include "../../modules.h" +#if JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER + +namespace jin +{ +namespace utils +{ + + enum Event + { + + }; + +} // tools +} // jin + +#endif // JIN_MODULES_TOOLS && JIN_TOOLS_EVENTMSGCENTER +#endif // __JIN_TOOLS_EVENTS_H \ No newline at end of file diff --git a/src/libjin/Utils/Json/Json.cpp b/src/libjin/Utils/Json/Json.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/libjin/Utils/Json/Json.h b/src/libjin/Utils/Json/Json.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/src/libjin/Utils/Json/Json.h @@ -0,0 +1 @@ +#pragma once diff --git a/src/libjin/Utils/XML/XML.cpp b/src/libjin/Utils/XML/XML.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/libjin/Utils/XML/XML.h b/src/libjin/Utils/XML/XML.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/src/libjin/Utils/XML/XML.h @@ -0,0 +1 @@ +#pragma once -- cgit v1.1-26-g67d0