Refactoring some of the poker game logic again.
This commit is contained in:
@ -7,20 +7,12 @@
|
||||
|
||||
#include "game.h"
|
||||
|
||||
testscene_t testScene;
|
||||
|
||||
bool gameInit(game_t *game) {
|
||||
// Init the game
|
||||
game->name = GAME_NAME;
|
||||
|
||||
// Init the engine and the rendering pipeline
|
||||
engineInit(&game->engine, game);
|
||||
|
||||
// Hand off to the poker logic.
|
||||
testSceneInit(&testScene, game);
|
||||
// pokerInit(&game->poker, &game->engine);
|
||||
|
||||
return true;
|
||||
// Send off to the game instance
|
||||
return pokerGameInit(game);
|
||||
}
|
||||
|
||||
bool gameUpdate(game_t *game, float platformDelta) {
|
||||
@ -28,15 +20,13 @@ bool gameUpdate(game_t *game, float platformDelta) {
|
||||
engineUpdateStart(&game->engine, game, platformDelta);
|
||||
|
||||
// Hand off to the poker logic
|
||||
testSceneRender(&testScene, game);
|
||||
// pokerUpdate(&game->poker, &game->engine);
|
||||
pokerGameUpdate(game);
|
||||
|
||||
|
||||
// Hand back to the engine.
|
||||
return engineUpdateEnd(&game->engine, game);
|
||||
}
|
||||
|
||||
void gameDispose(game_t *game) {
|
||||
pokerDispose(&game->poker);
|
||||
pokerGameDispose(game);
|
||||
engineDispose(&game->engine, game);
|
||||
}
|
@ -6,8 +6,7 @@
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "../engine/engine.h"
|
||||
#include "../poker/poker.h"
|
||||
#include "../test/testscene.h"
|
||||
#include "poker/pokergame.h"
|
||||
|
||||
/**
|
||||
* Initialize the game context.
|
||||
|
23
src/game/poker/pokergame.c
Normal file
23
src/game/poker/pokergame.c
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "pokergame.h"
|
||||
|
||||
bool pokerGameInit(game_t *game) {
|
||||
// Init the game
|
||||
game->name = POKER_GAME_NAME;
|
||||
|
||||
// Hand off to the poker logic.
|
||||
pokerInit(&game->pokerGame.poker, &game->engine);
|
||||
}
|
||||
|
||||
void pokerGameUpdate(game_t *game) {
|
||||
}
|
||||
|
||||
void pokerGameDispose(game_t *game) {
|
||||
|
||||
}
|
30
src/game/poker/pokergame.h
Normal file
30
src/game/poker/pokergame.h
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "../../poker/poker.h"
|
||||
|
||||
/**
|
||||
* Initializes the game state for the poker game.
|
||||
*
|
||||
* @param game Game to initialize.
|
||||
* @returns True if successful, otherwise false.
|
||||
*/
|
||||
bool pokerGameInit(game_t *game);
|
||||
|
||||
/**
|
||||
* Updates the poker game instance.
|
||||
* @param game Game to update for.
|
||||
*/
|
||||
void pokerGameUpdate(game_t *game);
|
||||
|
||||
/**
|
||||
* Disposes a previously initialized poker game instance.
|
||||
* @param game Game to initialize for.
|
||||
*/
|
||||
void pokerGameDispose(game_t *game);
|
Reference in New Issue
Block a user