-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBehaviorTreeComponent.h
More file actions
62 lines (55 loc) · 1.92 KB
/
Copy pathBehaviorTreeComponent.h
File metadata and controls
62 lines (55 loc) · 1.92 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
#pragma once
#include "Component.h"
#include "IAIComponent.h"
#include "AIManager.h"
#include "ClrHost.h"
using namespace BT;
class BehaviorTreeComponent :
public meta::identity<BehaviorTreeComponent, Component>, public IAIComponent
{
public:
static consteval auto reflect()
{
return meta::schema<Self>(
meta::field<&Self::name>,
meta::field<&Self::blackBoardName>,
meta::field<&Self::m_BehaviorTreeGuid>,
meta::field<&Self::m_BlackBoardGuid>);
}
public:
BehaviorTreeComponent() = default;
std::string name; // BT 에셋 이름
std::string blackBoardName;
// IAIComponent 인터페이스 구현
void Initialize() override;
void OnInitialized() override;
void OnAddedToScene() override;
void OnRemovingFromScene() override;
void InternalAIUpdate(float deltaSecond) override;
void OnUninitializing() override;
BlackBoard* GetBlackBoard();
private:
// Behavior Tree 관련 메서드
private:
// ???洹몃옒?꾨? ?됲룊?섍쾶 ?댁꽌 愿由?痢≪뿉 ?섍린怨??몄뒪?댁뒪 id瑜?諛쏅뒗??(PHASE 9-8).
// 議곕┰怨??깆? ?꾨? 愿由?痢≪뿉???앸궃?????ㅼ씠?곕툕??id留??좊떎.
void SendGraphToManaged(const BTBuildGraph& graph);
public:
void GraphToBuild();
void ClearTree()
{
// 愿由?痢??몃━瑜??대┛?? ?ㅼ씠?곕툕?먮뒗 ???댁긽 ?몃━ ?ㅼ껜媛 ?녿떎.
if (m_treeInstanceId < 0) return;
ClrHost::Get().DestroyBehaviorTree(m_treeInstanceId);
m_treeInstanceId = -1;
}
public:
// Behavior Tree의 GUID 직렬화 및 역직렬화를 위한 구조
FileGuid m_BehaviorTreeGuid; // Behavior Tree의 GUID
FileGuid m_BlackBoardGuid; // 블랙보드의 GUID
private:
BlackBoard* m_pBlackboard; // 블랙보드 데이터
// 愿由?痢??몃━ ?몄뒪?댁뒪 id. ?뚯닔硫??몃━媛 ?녿떎.
// m_root쨌m_built媛 ?덈뜕 ?먮━?????몃━ ?ㅼ껜???댁젣 愿由?痢≪뿉 ?덈떎.
int m_treeInstanceId{ -1 };
};