-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcomponent.h
More file actions
68 lines (58 loc) · 2.1 KB
/
component.h
File metadata and controls
68 lines (58 loc) · 2.1 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
//--------------------------------------------------------------------------------
// コンポネントスーパークラス
// component.h
// Author : Xu Wenjie
// Date : 2017-05-18
//--------------------------------------------------------------------------------
#ifndef _COMPONENT_H_
#define _COMPONENT_H_
//--------------------------------------------------------------------------------
// インクルードファイル
//--------------------------------------------------------------------------------
#include "main.h"
//--------------------------------------------------------------------------------
// 前方宣言
//--------------------------------------------------------------------------------
class CGameObject;
//--------------------------------------------------------------------------------
// クラス宣言
//--------------------------------------------------------------------------------
class CComponent
{
public:
//--------------------------------------------------------------------------------
// 構造体定義
//--------------------------------------------------------------------------------
enum MESSAGE
{
M_MOVE,
M_JUMP,
M_LANDING,
M_MAX
};
//--------------------------------------------------------------------------------
// 関数定義
//--------------------------------------------------------------------------------
CComponent(CGameObject* const pGameObj) : m_pGameObj(pGameObj) {}
~CComponent() {}
virtual bool Init(void) = 0;
virtual void Uninit(void) = 0;
virtual void Release(void)
{
Uninit();
delete this;
}
//virtual void ReceiveMsg(const MESSAGE &msg) {}
//Get関数
CGameObject* const GetGameObject(void) const { return m_pGameObj; }
protected:
//--------------------------------------------------------------------------------
// 関数定義
//--------------------------------------------------------------------------------
CComponent() : m_pGameObj(nullptr) {}
//--------------------------------------------------------------------------------
// 変数定義
//--------------------------------------------------------------------------------
CGameObject* const m_pGameObj;
};
#endif