Cogs.Core
ScriptSystem.h
1#pragma once
2
3#include "Systems/ComponentSystem.h"
4
5#include "Components/Core/ScriptComponent.h"
6
7#include "Scripting/ScriptingEngine.h"
8
9namespace Cogs
10{
11 namespace Core
12 {
13 class Context;
14
17 {
18 ScriptContextHandle scriptContext;
19 };
20
21 class ScriptSystem : public ComponentSystemWithDataPool<ScriptComponent, ScriptData>
22 {
23 public:
24 ScriptSystem(Memory::Allocator * allocator, SizeType capacity) : ComponentSystemWithDataPool(allocator, capacity) {}
25
26 void update(Context * context);
27
28 COGSCORE_DLL_API ScriptContextHandle getScriptContext(ScriptComponent * scriptComponent, ScriptFlags flags);
29 };
30 }
31}
Context * context
Pointer to the Context instance the system lives in.
void update()
Updates the system state to that of the current frame.
Component system with parallel data per component stored in a pool similar to how the components them...
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Base allocator implementation.
Definition: Allocator.h:30
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
ComponentIndex SizeType
Type used to track the size of pools.
Definition: Component.h:19
Holds calculated data for a single script instance.
Definition: ScriptSystem.h:17