ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
载入中...
搜索中...
未找到
System.h
浏览该文件的文档.
1#pragma once
3
4
5namespace Shit {
6 class Scene;
7 class Component;
16 public:
17 System(int priority = 0);
18 virtual ~System();
19
20 virtual void init() = 0;
21 virtual void update() = 0;
22 virtual void destroy() = 0;
23
24 // --- getter & setter ---
25 Scene* getScene() const { return m_scene; }
26 void setScene(Scene* scene) { m_scene = scene; }
27
28 int getPriority() const { return m_priority; }
29 void setPriority(int priority) { m_priority = priority; }
30
31 protected:
33 Scene* m_scene = nullptr;
34 };
35}
#define SHIT_API
定义 Core.h:12
组件基类
定义 Component.h:18
场景类
定义 Scene.h:34
Scene * getScene() const
定义 System.h:25
void setPriority(int priority)
定义 System.h:29
void setScene(Scene *scene)
定义 System.h:26
System(int priority=0)
Scene * m_scene
所属场景
定义 System.h:33
virtual void update()=0
每帧更新(纯虚)
virtual ~System()
virtual void init()=0
初始化
int getPriority() const
定义 System.h:28
int m_priority
优先级(小值先执行)
定义 System.h:32
virtual void destroy()=0
销毁(纯虚)
定义 AudioPlayer.h:9