ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
Toggle main menu visibility
载入中...
搜索中...
未找到
System.h
浏览该文件的文档.
1
#pragma once
2
#include "
ShitEngine/Core/Core.h
"
3
4
5
namespace
Shit
{
6
class
Scene
;
7
class
Component
;
15
class
SHIT_API
System
{
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
:
32
int
m_priority
;
33
Scene
*
m_scene
=
nullptr
;
34
};
35
}
Core.h
SHIT_API
#define SHIT_API
定义
Core.h:12
Shit::Component
组件基类
定义
Component.h:18
Shit::Scene
场景类
定义
Scene.h:34
Shit::System::getScene
Scene * getScene() const
定义
System.h:25
Shit::System::setPriority
void setPriority(int priority)
定义
System.h:29
Shit::System::setScene
void setScene(Scene *scene)
定义
System.h:26
Shit::System::System
System(int priority=0)
Shit::System::m_scene
Scene * m_scene
所属场景
定义
System.h:33
Shit::System::update
virtual void update()=0
每帧更新(纯虚)
Shit::System::~System
virtual ~System()
Shit::System::init
virtual void init()=0
初始化
Shit::System::getPriority
int getPriority() const
定义
System.h:28
Shit::System::m_priority
int m_priority
优先级(小值先执行)
定义
System.h:32
Shit::System::destroy
virtual void destroy()=0
销毁(纯虚)
Shit
定义
AudioPlayer.h:9
ShitEngine
System
System.h
制作者
1.17.0