Just thiknking about how to put it all together.
This commit is contained in:
15
src/game/poker/actions/action.c
Normal file
15
src/game/poker/actions/action.c
Normal 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;
|
||||
}
|
19
src/game/poker/actions/action.h
Normal file
19
src/game/poker/actions/action.h
Normal 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);
|
0
src/game/poker/actions/round.c
Normal file
0
src/game/poker/actions/round.c
Normal file
8
src/game/poker/actions/round.h
Normal file
8
src/game/poker/actions/round.h
Normal 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>
|
||||
|
35
src/game/poker/actions/start.c
Normal file
35
src/game/poker/actions/start.c
Normal 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;
|
||||
}
|
21
src/game/poker/actions/start.h
Normal file
21
src/game/poker/actions/start.h
Normal 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);
|
@ -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);
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user