Plasma Engine  2.0
Loading...
Searching...
No Matches
LineToComponent.h
1#pragma once
2
3#include <GameComponentsPlugin/GameComponentsDLL.h>
4
5#include <Core/World/Component.h>
6#include <Core/World/ComponentManager.h>
7
8class plLineToComponentManager : public plComponentManager<class plLineToComponent, plBlockStorageType::FreeList>
9{
11
12public:
14
15protected:
16 void Initialize() override;
17 void Update(const plWorldModule::UpdateContext& context);
18};
19
21class PL_GAMECOMPONENTS_DLL plLineToComponent : public plComponent
22{
23 PL_DECLARE_COMPONENT_TYPE(plLineToComponent, plComponent, plLineToComponentManager);
24
26 // plComponent
27
28public:
29 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
30 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
31
33 // plLineToComponent
34
35public:
38
39 const char* GetLineToTargetGuid() const; // [ property ]
40 void SetLineToTargetGuid(const char* szTargetGuid); // [ property ]
41
42 void SetLineToTarget(const plGameObjectHandle& hTargetObject); // [ property ]
43 const plGameObjectHandle& GetLineToTarget() const { return m_hTargetObject; } // [ property ]
44
45 plColor m_LineColor; // [ property ]
46
47protected:
48 void Update();
49
50 plGameObjectHandle m_hTargetObject;
51};
plColor represents an RGBA color in linear color space. Values are stored as float,...
Definition Color.h:44
Base class of all component types.
Definition Component.h:25
virtual void SerializeComponent(plWorldWriter &inout_stream) const
Override this to save the current state of the component to the given stream.
Definition Component.cpp:54
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
Definition ComponentManager.h:88
Draws a line from its own position to the target object position.
Definition LineToComponent.h:22
Definition LineToComponent.h:9
void Initialize() override
This method is called after the constructor. A derived type can override this method to do initializa...
Definition LineToComponent.cpp:103
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
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
A handle to a game object.
Definition Declarations.h:76
Definition WorldModule.h:33