Just writing code nothing special.
This commit is contained in:
14
src/game/poker/actions/bet.c
Normal file
14
src/game/poker/actions/bet.c
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "bet.h"
|
||||
|
||||
queueaction_t * pokerGameActionBetAdd(pokergame_t *game) {
|
||||
queueaction_t *action = pokerGameActionAdd(game);
|
||||
|
||||
return action;
|
||||
}
|
12
src/game/poker/actions/bet.h
Normal file
12
src/game/poker/actions/bet.h
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* 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"
|
||||
|
||||
queueaction_t * pokerGameActionBetAdd(pokergame_t *game);
|
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (c) 2021 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "round.h"
|
||||
|
||||
void _pokerGameActionRoundOnStart(
|
||||
queue_t *queue, queueaction_t *action, uint8_t i
|
||||
) {
|
||||
queueNext(queue);
|
||||
}
|
||||
|
||||
void _pokerGameActionRoundOnEnd(queue_t *queue,queueaction_t *action,uint8_t i){
|
||||
pokerdiscussiondata_t data;
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
|
||||
// Start the round
|
||||
pokerActionRoundAdd(queue, &game->poker);
|
||||
|
||||
// Speak
|
||||
data.poker = game;
|
||||
data.reason = POKER_DISCUSSION_REASON_ROUND_START;
|
||||
pokerDiscussionQueue(&data);
|
||||
|
||||
// Take the blinds.
|
||||
pokerActionBlindsAdd(queue, &game->poker);
|
||||
|
||||
// Speak
|
||||
data.reason = POKER_DISCUSSION_REASON_BLINDS_TAKEN;
|
||||
pokerDiscussionQueue(&data);
|
||||
|
||||
// Deal
|
||||
pokerActionDealAdd(queue, &game->poker);
|
||||
|
||||
// Begin Betting Round
|
||||
}
|
||||
|
||||
queueaction_t * pokerGameActionRoundAdd(pokergame_t *game) {
|
||||
queueaction_t *action = pokerGameActionAdd(game);
|
||||
action->onStart = &_pokerGameActionRoundOnStart;
|
||||
action->onEnd = &_pokerGameActionRoundOnEnd;
|
||||
return action;
|
||||
}
|
@ -5,4 +5,21 @@
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "action.h"
|
||||
#include "../../../poker/actions/round.h"
|
||||
#include "../../../poker/actions/blinds.h"
|
||||
#include "../../../poker/actions/deal.h"
|
||||
|
||||
void _pokerGameActionRoundOnStart(
|
||||
queue_t *queue, queueaction_t *action, uint8_t i
|
||||
);
|
||||
|
||||
void _pokerGameActionRoundOnEnd(queue_t *queue,queueaction_t *action,uint8_t i);
|
||||
|
||||
/**
|
||||
* Queues the round starting action onto the game. Handles talking VN logic.
|
||||
*
|
||||
* @param game Game to add to.
|
||||
* @return The queued action.
|
||||
*/
|
||||
queueaction_t * pokerGameActionRoundAdd(pokergame_t *game);
|
@ -10,26 +10,28 @@
|
||||
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){
|
||||
pokerdiscussiondata_t data;
|
||||
pokergame_t *game = (pokergame_t *)action->data;
|
||||
|
||||
|
||||
// Begin the match
|
||||
pokerActionMatchAdd(&game->scene.conversation.actionQueue, &game->poker);
|
||||
vnConversationTalk(&game->scene.conversation,
|
||||
"The game is No Limits Texas Hold'em.", NULL
|
||||
);
|
||||
|
||||
// Say that.
|
||||
data.poker = game;
|
||||
data.reason = POKER_DISCUSSION_REASON_MATCH_START;
|
||||
pokerDiscussionQueue(&data);
|
||||
|
||||
// Begin Round.
|
||||
pokerGameActionRoundAdd(game);
|
||||
}
|
||||
|
||||
queueaction_t * pokerGameActionStartAdd(pokergame_t *game) {
|
||||
queueaction_t *action = pokerGameActionAdd(game);
|
||||
|
||||
action->onStart = &_pokerGameActionStartOnStart;
|
||||
action->onEnd = &_pokerGameActionStartOnEnd;
|
||||
|
||||
return action;
|
||||
}
|
@ -10,6 +10,7 @@
|
||||
#include "../../../vn/conversation/talk.h"
|
||||
#include "../../../display/animation/queue.h"
|
||||
#include "../../../poker/actions/match.h"
|
||||
#include "../discussion/pokerdiscussion.h"
|
||||
#include "action.h"
|
||||
|
||||
void _pokerGameActionStartOnStart(
|
||||
@ -18,4 +19,11 @@ void _pokerGameActionStartOnStart(
|
||||
|
||||
void _pokerGameActionStartOnEnd(queue_t *queue,queueaction_t *action,uint8_t i);
|
||||
|
||||
/**
|
||||
* Queues a match starting action onto the queue, also handles game logic for
|
||||
* speaking VN style.
|
||||
*
|
||||
* @param game Game to add to.
|
||||
* @return The queued action.
|
||||
*/
|
||||
queueaction_t * pokerGameAcionStartAdd(pokergame_t *game);
|
Reference in New Issue
Block a user