mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
Optimized the structure
This commit is contained in:
@@ -2,10 +2,7 @@
|
||||
#include "Game.h"
|
||||
|
||||
|
||||
Game::Game(int g_width, int g_heith)
|
||||
: Width(g_width),
|
||||
Height(g_heith),
|
||||
m_render(std::make_unique<Renderer>())
|
||||
Game::Game()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -22,9 +19,7 @@ void Game::cleanup() {
|
||||
|
||||
|
||||
bool Game::initialize() {
|
||||
if (!m_render->initialize()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +30,4 @@ bool Game::initialize() {
|
||||
}
|
||||
|
||||
|
||||
void Game::render() {
|
||||
m_render->Renderhello();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,22 +3,21 @@
|
||||
#include <SDL3/SDL.h>
|
||||
#include <memory>
|
||||
//#include "Board.h"
|
||||
#include "ui/Render.h"
|
||||
|
||||
|
||||
|
||||
|
||||
class Game {
|
||||
private:
|
||||
|
||||
std::unique_ptr<Renderer> m_render;
|
||||
int Width;
|
||||
int Height;
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
Game(int g_width, int g_heith);
|
||||
Game();
|
||||
~Game();
|
||||
void cleanup();
|
||||
bool initialize();
|
||||
void render();
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user