summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Component.h
blob: 807bbba8a321c490997f9414bf1c9664b6f7d445 (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
#ifndef __AE_COMPONENT_H__
#define __AE_COMPONENT_H__

#include "GameObject.h"

namespace AsuraEngine
{

    class GameObject;

    ///
    /// ComponentͨprefabGameObjectϡ
    ///
    class Component : public Object
    {
    public:

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

    protected:

        enum class EnableCallback
        {
            OnEnable  = 1, 
            OnEvent   = 1 << 1,
            OnUpdate  = 1 << 2,
            OnRender  = 1 << 3,
            OnDisable = 1 << 4,
        };

        EnableCallback mEnabledCallbacks;

        GameObject* mGameObject;

    };

}

#endif