/** * Copyright (c) 2021 Dominic Masters * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ #pragma once #include "../../libs.h" #include "pokergameassets.h" #include "../../poker/poker.h" #include "../../vn/conversation/talk.h" #include "../../vn/vnscene.h" #include "../../util/array.h" #include "actions/start.h" #include "ui/pokerui.h" #include "pokerworld.h" #include "actions/start.h" #define POKER_GAME_SEAT_COUNT 8 #define POKER_GAME_SEAT_FOR_PLAYER(p) (p - (POKER_PLAYER_COUNT/2)) #define POKER_GAME_SEAT_DEALER POKER_GAME_SEAT_FOR_PLAYER(POKER_DEALER_INDEX) /** * Return the seat for a given player index, also works for the dealer index. * @param i The players index. * @return The players seat number. */ #define pokerGameSeatFromIndex(i) (\ i == POKER_DEALER_INDEX ? \ POKER_GAME_SEAT_DEALER : \ POKER_GAME_SEAT_FOR_PLAYER(i) \ ) #define POKER_GAME_PENNY_BASE_WIDTH 1000 #define POKER_GAME_PENNY_BASE_HEIGHT 1920 #define POKER_GAME_PENNY_FACE_X 367 #define POKER_GAME_PENNY_FACE_Y 256 #define POKER_GAME_PENNY_FACE_WIDTH 280 #define POKER_GAME_PENNY_FACE_HEIGHT 280 typedef struct { /** Poker Game State */ poker_t poker; /** Visual Novel Engine */ vnscene_t scene; /** Assets (Files) for the game. */ pokergameassets_t assets; /** Poker Game World. */ pokerworld_t world; /** UI For the Game */ pokerui_t ui; /** Data for the actions */ pokergameactiondata_t actionData[ANIMATION_QUEUE_ITEM_MAX]; /** Pointer back to the game engine */ engine_t *engine; } pokergame_t; /** * Initializes the game state for the poker game. * * @param game Game to initialize. * @param engine Engine to use when initializing. * @returns True if successful, otherwise false. */ bool pokerGameInit(pokergame_t *game, engine_t *engine); /** * Updates the poker game instance. * @param game Poker game to update for. * @param engine Engine to use during update. */ void pokerGameUpdate(pokergame_t *game, engine_t *engine); /** * Disposes a previously initialized poker game instance. * @param game Game to dispose. */ void pokerGameDispose(pokergame_t *game); /** * Restacks the poker game's stack. * * @param pokerGame Poker game to restack */ void pokerGameQueueRestack(pokergame_t *pokerGame);