Cogs.Core
SceneSystem.h
1#pragma once
2
3#include "Systems/ComponentSystem.h"
4
5#include "Components/Core/SceneComponent.h"
6
7namespace Cogs
8{
9 namespace Core
10 {
11 class Context;
12
14 {
15 bool visible;
16 bool pickable;
17 };
18
23 class SceneSystem : public ComponentSystem<SceneComponent>
24 {
25 public:
26 SceneSystem(Memory::Allocator * allocator, SizeType capacity) : ComponentSystem(allocator, capacity) {}
27
29 void update(Context * context);
31
32 static void updateState(SceneComponent & sceneComponent);
33
34 private:
35 static SceneState getSceneState(const SceneComponent & sceneComponent);
36
37 bool needsPost = true;
38 };
39 }
40}
Context * context
Pointer to the Context instance the system lives in.
void postUpdate()
Perform post update logic in the system.
void update()
Updates the system state to that of the current frame.
Typed component system managing a pool of components with the given ComponentType.
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains information on how the entity behaves in the scene.
The scene system handles SceneComponent instances, managing hierarchical visibility and pickability b...
Definition: SceneSystem.h:24
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