summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/GameObject.h
blob: 85dc87f33d8f9d11ee496f59117270205da1dd8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef __AE_GAMEOBJECT_H__
#define __AE_GAMEOBJECT_H__

#include "./Containers/Vector.hpp"
#include "./Math/Vector2.h"

#include "Object.h"
#include "Component.h"
#include "Transform.h"
#include "Manager.hpp"

namespace AsuraEngine
{

    ///
    /// Ϸʵ壬
    ///
    class GameObject final : public Object
    {
    public:

        // Ļص

        void OnEnable();
        void OnEvent();
        void OnUpdate(uint32 milliseconds);
        void OnRender();
        void OnDisable();

        // transformͨк޸GameObjectλáźת

        const Transform& GetTransform();
        const Math::Vector2& GetPosition();
        const Math::Vector2& GetScale();
        const Math::Vector2& GetRotation();
        void SetTransform(const Transform& transform);
        void SetPosition(const Math::Vector2& position);
        void SetScale(const Math::Vector2& scale);
        void SetRotation(const Math::Vector2& rotation);

        template<typename T>
        inline T GetComponent()
        {
            return NULL;
        }

    private:

        Transform mTransform;
        Containers::Vector<Component*> mComponents;

    };

}

#endif