Plasma Engine  2.0
Loading...
Searching...
No Matches
PlayerStartPointComponent.h
1#pragma once
2
3#include <Core/ResourceManager/ResourceHandle.h>
4#include <Core/World/World.h>
5#include <Foundation/Containers/ArrayMap.h>
6#include <Foundation/Strings/HashedString.h>
7#include <Foundation/Types/RangeView.h>
8#include <Foundation/Types/Variant.h>
9#include <GameEngine/GameEngineDLL.h>
10
12
14
29class PL_GAMEENGINE_DLL plPlayerStartPointComponent : public plComponent
30{
32
34 // plComponent
35
36public:
37 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
38 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
39
41 // plPlayerStartPointComponent
42
43public:
46
47 void SetPlayerPrefabFile(const char* szFile); // [ property ]
48 const char* GetPlayerPrefabFile() const; // [ property ]
49
50 void SetPlayerPrefab(const plPrefabResourceHandle& hPrefab); // [ property ]
51 const plPrefabResourceHandle& GetPlayerPrefab() const; // [ property ]
52
53 const plRangeView<const char*, plUInt32> GetParameters() const; // [ property ] (exposed parameter)
54 void SetParameter(const char* szKey, const plVariant& value); // [ property ] (exposed parameter)
55 void RemoveParameter(const char* szKey); // [ property ] (exposed parameter)
56 bool GetParameter(const char* szKey, plVariant& out_value) const; // [ property ] (exposed parameter)
57
59
60 // TODO:
61 // add properties to differentiate use cases, such as
62 // single player vs. multi-player spawn points
63 // team number
64
65protected:
66 plPrefabResourceHandle m_hPlayerPrefab;
67};
See plArrayMapBase for details.
Definition ArrayMap.h:149
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
Defines a location that the player may start from.
Definition PlayerStartPointComponent.h:30
This class uses delegates to define a range of values that can be enumerated using a forward iterator...
Definition RangeView.h:24
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
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