ran a formatter on all the files for tab consistency
This commit is contained in:
53
src/Game.cpp
53
src/Game.cpp
@@ -1,20 +1,51 @@
|
||||
#include "Game.h"
|
||||
#include <RmlUi/Core.h>
|
||||
#include <RmlUi/Core/Context.h>
|
||||
#include <RmlUi/Core/DataModelHandle.h>
|
||||
#include <iostream>
|
||||
#include <raylib.h>
|
||||
#include <RmlUi/Core.h>
|
||||
|
||||
void Game::Draw2D() {return;}
|
||||
void Game::Draw2D() { return; }
|
||||
|
||||
void Game::Update() {
|
||||
// TODO: Remove this debug
|
||||
std::cout << "Game update" << std::endl;
|
||||
return;
|
||||
}
|
||||
void Game::Update() { return; }
|
||||
|
||||
bool Game::Init(Rml::Context *context) {
|
||||
if (!ctx) return false;
|
||||
|
||||
ctx = context;
|
||||
return true;
|
||||
if (!ctx)
|
||||
return false;
|
||||
|
||||
ctx = context;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Game::setup_rml_data_binding(Rml::Context *ctx,
|
||||
Rml::DataModelHandle &model_handle,
|
||||
GameData &game_data) {
|
||||
Rml::DataModelConstructor dmc = ctx->CreateDataModel("game_data");
|
||||
if (!dmc) {
|
||||
TraceLog(LOG_ERROR, "Failed to construct data model..");
|
||||
return false;
|
||||
}
|
||||
|
||||
dmc.Bind("game_state", &game_data.game_state);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Game::ResetGame() {}
|
||||
void Game::ShowMainMenu() {}
|
||||
|
||||
void Game::TrySetGameState(GameState newState) {
|
||||
GameState currentState = game_data.game_state;
|
||||
|
||||
switch (newState) {
|
||||
case START_MENU:
|
||||
if (currentState == IN_GAME)
|
||||
ResetGame();
|
||||
ShowMainMenu();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
game_data.game_state = newState;
|
||||
}
|
||||
Reference in New Issue
Block a user