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);
|
Reference in New Issue
Block a user