Just thiknking about how to put it all together.

This commit is contained in:
2021-07-29 10:01:58 -07:00
parent 6a666b64ca
commit 289e6fccfc
14 changed files with 233 additions and 23 deletions

View File

@ -0,0 +1,15 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "action.h"
queueaction_t * pokerGameActionAdd(pokergame_t *game) {
queueaction_t *action;
action = queueAdd(&game->scene.conversation.actionQueue);
action->data = (void *)game;
return action;
}

View File

@ -0,0 +1,19 @@
/**
* 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 "../../../vn/conversation/talk.h"
#include "../../../display/animation/queue.h"
/**
* Adds an action to the poker game scene's queue.
*
* @param game Game to add the action to.
* @return Action that was added to the game.
*/
queueaction_t * pokerGameActionAdd(pokergame_t *game);

View File

View File

@ -0,0 +1,8 @@
// Copyright (c) 2021 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include <dawn/dawn.h>

View File

@ -0,0 +1,35 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#include "start.h"
void _pokerGameActionStartOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
) {
pokergame_t *game = (pokergame_t *)action->data;
queueNext(queue);
}
void _pokerGameActionStartOnEnd(queue_t *queue,queueaction_t *action,uint8_t i){
pokergame_t *game = (pokergame_t *)action->data;
pokerActionMatchAdd(&game->scene.conversation.actionQueue, &game->poker);
vnConversationTalk(&game->scene.conversation,
"The game is No Limits Texas Hold'em.", NULL
);
pokerGameActionRoundAdd(game);
}
queueaction_t * pokerGameActionStartAdd(pokergame_t *game) {
queueaction_t *action = pokerGameActionAdd(game);
action->onStart = &_pokerGameActionStartOnStart;
action->onEnd = &_pokerGameActionStartOnEnd;
return action;
}

View File

@ -0,0 +1,21 @@
/**
* 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 "../../../vn/conversation/talk.h"
#include "../../../display/animation/queue.h"
#include "../../../poker/actions/match.h"
#include "action.h"
void _pokerGameActionStartOnStart(
queue_t *queue, queueaction_t *action, uint8_t i
);
void _pokerGameActionStartOnEnd(queue_t *queue,queueaction_t *action,uint8_t i);
queueaction_t * pokerGameAcionStartAdd(pokergame_t *game);

View File

@ -18,23 +18,16 @@ bool pokerGameInit(game_t *game) {
// Prep the VN Conversation Engine.
vnSceneInit(&pokerGame->scene, &pokerGame->assets.font);
pokerGameActionStartAdd(pokerGame);
vnConversationTalk(&pokerGame->scene.conversation, "LOTS AND LOTS AND LOTS AND LOTS AND LOTS AND LOTS AND LOTS AND LOTS", NULL);
pokerActionMatchAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionMatchAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionMatchAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionRoundAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionBlindsAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// pokerActionDealAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// vnConversationTalk(&pokerGame->scene.conversation, "Betting Round", NULL);
// pokerActionFlopAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
vnConversationTalk(&pokerGame->scene.conversation, "Start Round", NULL);
pokerActionRoundAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
vnConversationTalk(&pokerGame->scene.conversation, "Blinds Round", NULL);
pokerActionBlindsAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
vnConversationTalk(&pokerGame->scene.conversation, "Deal Round", NULL);
pokerActionDealAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
vnConversationTalk(&pokerGame->scene.conversation, "Betting Round", NULL);
vnConversationTalk(&pokerGame->scene.conversation, "Flop Round", NULL);
pokerActionFlopAdd(&pokerGame->scene.conversation.actionQueue, &pokerGame->poker);
// Begin the VN conversation queue.
queueNext(&pokerGame->scene.conversation.actionQueue);

View File

@ -11,12 +11,7 @@
#include "../../poker/poker.h"
#include "../../vn/conversation/talk.h"
#include "../../vn/vnscene.h"
#include "../../poker/actions/match.h"
#include "../../poker/actions/round.h"
#include "../../poker/actions/flop.h"
#include "../../poker/actions/deal.h"
#include "../../poker/actions/blinds.h"
#include "actions/start.h"
/**
* Initializes the game state for the poker game.