Added missing header comments.

This commit is contained in:
2021-08-29 10:07:42 -07:00
parent 01c26b9e16
commit 64a2dd5773
29 changed files with 184 additions and 73 deletions

View File

@ -8,8 +8,24 @@
#pragma once
#include <dawn/dawn.h>
/**
* Initializes the Dawn Game instance.
*
* @param game Game to instanciate.
* @return True if successful otherwise false.
*/
bool dawnGameInit(game_t *game);
/**
* Update the Dawn Game Instance.
*
* @param game Game to update.
*/
void dawnGameUpdate(game_t *game);
/**
* Cleanup the dawn game instance.
*
* @param game Game to dispose.
*/
void dawnGameDispose(game_t *game);

View File

@ -7,7 +7,6 @@
#pragma once
#include <dawn/dawn.h>
#include "../../../vn/conversation/talk.h"
#include "../../../display/animation/queue.h"
/**

View File

@ -10,12 +10,14 @@
void _pokerGameActionBetOnUpdate(
queue_t *queue, queueaction_t *action, uint8_t i
) {
// Restack
bool isHuman;
bool turnMade = false;
pokerturn_t turn;
pokergame_t *game = (pokergame_t *)action->data;
pokerplayer_t *player;
// Are they human?
player = game->poker.players + game->poker.bet.better;
isHuman = game->poker.bet.better == POKER_PLAYER_HUMAN_INDEX;

View File

@ -12,4 +12,20 @@
#include "../../../poker/bet.h"
#include "../../../poker/actions/flop.h"
/** Callback when the bet action is updated. */
void _pokerGameActionBetOnUpdate(
queue_t *queue, queueaction_t *action, uint8_t i
);
/** Callback for when the bet action ends. */
void _pokerGameActionBetOnEnd(
queue_t *queue, queueaction_t *action, uint8_t i
);
/**
* Queues the bet action to the queue.
*
* @param game Game to queue onto.
* @return The action that was queued.
*/
queueaction_t * pokerGameActionBetAdd(pokergame_t *game);

View File

@ -7,7 +7,6 @@
#include "look.h"
void _pokerGameActionLookOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
) {

View File

@ -11,6 +11,7 @@
#include "../../../display/animation/queue.h"
#include "../pokerworld.h"
/** Callback when the look action starts. */
void _pokerGameActionLookOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
);

View File

@ -0,0 +1,21 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "restack.h"
void _pokerGameActionRestackOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
) {
pokerGameQueueRestack(game);
queueNext(queue);
}
queueaction_t * pokerGameActionRestackAdd(pokergame_t *game) {
queueaction_t *action = pokerGameActionAdd(game);
action->onStart = &_pokerGameActionRestackOnStart;
return action;
}

View File

@ -0,0 +1,27 @@
/**
* 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 "action.h"
#include "../pokergame.h"
#include "../../../poker/turn.h"
#include "../../../poker/bet.h"
#include "../../../poker/actions/flop.h"
/** Callback for when the queue restack action stars. */
void _pokerGameActionRestackOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
);
/**
* Adds a restack action to the queue.
*
* @param game Game to restack.
* @return The queued action.
*/
queueaction_t * pokerGameActionRestackAdd(pokergame_t *game);

View File

@ -13,10 +13,12 @@
#include "../discussion/pokerdiscussion.h"
#include "bet.h"
/** Callback that is fired when the round start event starts. */
void _pokerGameActionRoundOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
);
/** Callback that is fired when the round action ends. */
void _pokerGameActionRoundOnEnd(queue_t *queue,queueaction_t *action,uint8_t i);
/**

View File

@ -14,10 +14,12 @@
#include "action.h"
#include "round.h"
/** Callback fired when the game action first starts */
void _pokerGameActionStartOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
);
/** Callback fired when the game start action ends */
void _pokerGameActionStartOnEnd(queue_t *queue,queueaction_t *action,uint8_t i);
/**

View File

@ -11,8 +11,16 @@
#include "../../../vn/conversation/talk.h"
#include "../actions/look.h"
void pokerDiscussionGet(
pokerdiscussion_t *discussion, pokerdiscussiondata_t *data
);
/**
* Retreives the discussion based on some discussion data.
* @param disc The discussion data to buffer into.
* @param data The discussion data.
*/
void pokerDiscussionGet(pokerdiscussion_t *disc, pokerdiscussiondata_t *data);
/**
* Queue a discussion data result onto the conversation stack.
*
* @param data The discussion data.
*/
void pokerDiscussionQueue(pokerdiscussiondata_t *data);

View File

@ -68,4 +68,15 @@ void pokerGameDispose(game_t *game) {
// Unload all assets
pokerGameAssetsDispose(&pokerGame->assets);
}
void pokerGameQueueRestack(pokergame_t *pokerGame) {
arrayRewind(
sizeof(pokergameactiondata_t),
pokerGame->actionData,
ANIMATION_QUEUE_ITEM_MAX,
pokerGame->scene.conversation.actionQueue.current,
pokerGame->scene.conversation.actionQueue.count
);
queueRestack(&pokerGame->scene.conversation.actionQueue);
}

View File

@ -11,6 +11,7 @@
#include "../../poker/poker.h"
#include "../../vn/conversation/talk.h"
#include "../../vn/vnscene.h"
#include "../../util/array.h"
#include "actions/start.h"
#include "pokerui.h"
#include "pokerworld.h"
@ -34,4 +35,11 @@ void pokerGameUpdate(game_t *game);
* Disposes a previously initialized poker game instance.
* @param game Game to initialize for.
*/
void pokerGameDispose(game_t *game);
void pokerGameDispose(game_t *game);
/**
* Restacks the poker game's stack.
*
* @param pokerGame Poker game to restack
*/
void pokerGameQueueRestack(pokergame_t *pokerGame);

View File

@ -11,5 +11,17 @@
#include "../../locale/language.h"
#include "../../display/texture.h"
/**
* Load and initializes all the assets used by the poker game.
*
* @param assets Assets instance to initailize.
* @return True if successful, otherwise false.
*/
bool pokerGameAssetsInit(pokergameassets_t *assets);
/**
* Cleans a previously initialized game assets set.
*
* @param assets Assets to dispose.
*/
void pokerGameAssetsDispose(pokergameassets_t *assets);

View File

@ -9,8 +9,23 @@
#include <dawn/dawn.h>
#include "../../ui/label.h"
/**
* Initializes the UI Module.
*
* @param pokerGame Poker game to initialize the UI for.
*/
void pokerUiInit(pokergame_t *pokerGame);
/**
* Render the Poker Game UI.
*
* @param pokerGame Game to render the UI for.
*/
void pokerUiRender(pokergame_t *pokerGame);
/**
* Cleanup only the UI elements for a poker game.
*
* @param pokerGame Game to dispose the UI for.
*/
void pokerUiDispose(pokergame_t *pokerGame);