Plasma Engine  2.0
Loading...
Searching...
No Matches
ScriptClassResource.h
1#pragma once
2
3#include <Core/ResourceManager/Resource.h>
4#include <Core/Scripting/ScriptCoroutine.h>
5#include <Core/Scripting/ScriptRTTI.h>
6
7class plWorld;
9
10class PL_CORE_DLL plScriptClassResource : public plResource
11{
12 PL_ADD_DYNAMIC_REFLECTION(plScriptClassResource, plResource);
13 PL_RESOURCE_DECLARE_COMMON_CODE(plScriptClassResource);
14
15public:
18
19 const plSharedPtr<plScriptRTTI>& GetType() const { return m_pType; }
20
21 virtual plUniquePtr<plScriptInstance> Instantiate(plReflectedClass& inout_owner, plWorld* pWorld) const = 0;
22
23protected:
24 plSharedPtr<plScriptRTTI> CreateScriptType(plStringView sName, const plRTTI* pBaseType, plScriptRTTI::FunctionList&& functions, plScriptRTTI::MessageHandlerList&& messageHandlers);
25 void DeleteScriptType();
26
27 plSharedPtr<plScriptCoroutineRTTI> CreateScriptCoroutineType(plStringView sScriptClassName, plStringView sFunctionName, plUniquePtr<plRTTIAllocator>&& pAllocator);
28 void DeleteAllScriptCoroutineTypes();
29
32};
Definition DynamicArray.h:81
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
The base class for all resources.
Definition Resource.h:10
Definition ScriptClassResource.h:11
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
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
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22