Plasma Engine  2.0
Loading...
Searching...
No Matches
AiPerceptionManager.h
1#pragma once
2
3#include <AiPlugin/AiPluginDLL.h>
4#include <Foundation/Containers/HybridArray.h>
5#include <Foundation/Types/UniquePtr.h>
6#include <AiPlugin/UtilityAI/Framework/AiPerceptionGenerator.h>
7
8class plGameObject;
10
11class PL_AIPLUGIN_DLL plAiPerceptionManager
12{
13 PL_DISALLOW_COPY_AND_ASSIGN(plAiPerceptionManager);
14
15public:
18
19 void FlagPerceptionTypeAsNeeded(plStringView sPerceptionType);
20
21 void AddGenerator(plUniquePtr<plAiPerceptionGenerator>&& pGenerator);
22
23 void FlagNeededSensors(plAiSensorManager& ref_SensorManager);
24
25 void UpdateNeededPerceptions(plGameObject& owner, const plAiSensorManager& ref_SensorManager);
26
27 bool HasPerceptionsOfType(plStringView sPerceptionType) const;
28 void GetPerceptionsOfType(plStringView sPerceptionType, plDynamicArray<const plAiPerception*>& out_Perceptions) const;
29
30private:
31 struct PerceptionInfo
32 {
33 plUniquePtr<plAiPerceptionGenerator> m_pPerceptionGenerator;
34 plUInt32 m_uiNeededInUpdate = 0;
35 };
36
37 plUInt32 m_uiUpdateCount = 1;
38 plHybridArray<PerceptionInfo, 12> m_PerceptionGenerators;
39};
Definition AiPerceptionManager.h:12
Definition AiSensorManager.h:10
Definition DynamicArray.h:81
This class represents an object inside the world.
Definition GameObject.h:32
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10