Plasma Engine  2.0
Loading...
Searching...
No Matches
SoldierComponent.h
1#pragma once
2
3#include <RecastPlugin/Components/NpcComponent.h>
4#include <RecastPlugin/RecastPluginDLL.h>
5
9
11
12class PL_RECASTPLUGIN_DLL plSoldierComponent : public plNpcComponent
13{
15
17 // plComponent
18
19public:
20 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
21 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
22
23protected:
24 virtual void Deinitialize() override;
25 virtual void OnSimulationStarted() override;
26
27
29 // plSoldierComponent
30
31public:
34
35protected:
36 void Update();
37
38 void SteeringEventHandler(const plAgentSteeringEvent& e);
39
40 enum class State
41 {
42 Idle,
43 WaitingForPath,
44 Walking,
45 ErrorState,
46 };
47
48 State m_State = State::Idle;
49 plComponentHandle m_hSteeringComponent;
50};
virtual void Deinitialize()
This method is called before the component is destroyed. A derived type can override this method to d...
Definition Component.cpp:133
virtual void OnSimulationStarted()
This method is called once for active components, at the start of the next world update,...
Definition Component.cpp:144
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
Base class for all components that implement 'non player character' behavior. Ie, game logic for how ...
Definition NpcComponent.h:10
virtual void DeserializeComponent(plWorldReader &inout_stream) override
Override this to load the current state of the component from the given stream.
Definition NpcComponent.cpp:31
virtual void SerializeComponent(plWorldWriter &inout_stream) const override
Override this to save the current state of the component to the given stream.
Definition NpcComponent.cpp:25
Definition PhysicsWorldModule.h:109
Definition RecastWorldModule.h:16
Definition SoldierComponent.h:13
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
Definition AgentSteeringComponent.h:9
A handle to a component.
Definition Declarations.h:138