GigaPasjans
Loading...
Searching...
No Matches
IGame.h
1// Wykonane przez Piotra ChudziƄskiego w dniu 10.04.2025
2#pragma once
3
4#include <andromenda/Surface.h>
5#include <foundation/Common.h>
6#include "GameObject.h"
7#include "GameOptions.h"
8#include "VfsManager.h"
9
10namespace Phosphorus
11{
17 {
23
28 int32 Version;
29
34 std::function<GameObject *()> GameSettingsSupplier;
35 };
36
41 class IGame : public GameObjectRegistry
42 {
43 protected:
44 friend class GameSerializer;
45 friend class GameBootstrapper;
46
52
58
64
65 public:
66 GameObject *GameSettings;
67
68 IGame(GameOptions &options, Andromenda::Surface *surface) : m_Options(options), m_Surface(surface) {};
69
70 // todo: safely delete it
71 void Register();
72
73 ~IGame() override = default;
74
80
85 virtual void Run() = 0;
86
91 virtual void OnSurfaceCallback(const String &id) = 0;
92
97 virtual void OnRender() = 0;
98 };
99} // namespace Phosphorus
The renderer of component registry.
Definition Surface.h:28
Represents named set of parameters which can be serialized.
Definition GameObject.h:274
Storage of GameObjects (scene). GameObjectRegistry take over ownership of object.
Definition GameObject.h:372
Represents serializable GameObjectRegistry with rendering, asset manager.
Definition IGame.h:42
virtual void Run()=0
Game entry point.
virtual void OnRender()=0
Event called when game is rerendered.
virtual void OnSurfaceCallback(const String &id)=0
Event called when any component sends callback.
GameOptions m_Options
Game options determined by GameBootstrapper.
Definition IGame.h:51
virtual ProductInfo GetProductInfo()=0
Returns product info by derived class.
VfsManager m_VfsManager
Main game asset manager.
Definition IGame.h:63
Andromenda::Surface * m_Surface
Main game renderer.
Definition IGame.h:57
Virtual file storage manager.
Definition VfsManager.h:16
Represents a mutable sequence of characters, providing various member functions for string manipulati...
Definition String.h:16
Game launch options.
Definition GameOptions.h:11
Game product info.
Definition IGame.h:17
String Name
Product name.
Definition IGame.h:22
int32 Version
Game version.
Definition IGame.h:28
std::function< GameObject *()> GameSettingsSupplier
Lambda for creating game settings.
Definition IGame.h:34