Moved GUI out of GUI.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include <dawn/dawn.h>
|
||||
#include "../spritebatch.h"
|
||||
#include "spritebatch.h"
|
||||
|
||||
/**
|
||||
* Get the division for a given character.
|
@ -8,10 +8,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <dawn/dawn.h>
|
||||
#include "../texture.h"
|
||||
#include "../primitive.h"
|
||||
#include "../primitives/quad.h"
|
||||
#include "../../util/mem.h"
|
||||
#include "texture.h"
|
||||
#include "primitive.h"
|
||||
#include "primitives/quad.h"
|
||||
#include "../util/mem.h"
|
||||
|
||||
/**
|
||||
* Initializes Font from raw TTF data.
|
@ -9,7 +9,7 @@
|
||||
#include <dawn/dawn.h>
|
||||
#include "../display/shader.h"
|
||||
#include "../display/texture.h"
|
||||
#include "../display/gui/font.h"
|
||||
#include "../display/font.h"
|
||||
|
||||
/**
|
||||
* Method to load an asset into memory as a raw string.
|
||||
|
@ -34,47 +34,41 @@ void _pokerGameActionBetOnUpdate(
|
||||
// Now decide if we should do something.
|
||||
if(!turnMade) return;
|
||||
|
||||
// What happened?
|
||||
char *debugAction;
|
||||
switch(turn.type) {
|
||||
// Player bets
|
||||
case POKER_TURN_TYPE_BET:
|
||||
debugAction = "betting";
|
||||
//TODO: Is it a BET or a CALL?
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_RAISING;
|
||||
pokerBetPlayer(&game->poker, player, turn.chips);
|
||||
break;
|
||||
|
||||
// Player folds
|
||||
case POKER_TURN_TYPE_FOLD:
|
||||
debugAction = "folding";
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_FOLDING;
|
||||
player->state |= POKER_PLAYER_STATE_FOLDED;
|
||||
break;
|
||||
|
||||
// Player checks
|
||||
case POKER_TURN_TYPE_CHECK:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CHECKING;
|
||||
debugAction = "checking";
|
||||
break;
|
||||
|
||||
// Player may be out
|
||||
default:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_TEST;
|
||||
debugAction = "doing nothing";
|
||||
break;
|
||||
}
|
||||
|
||||
// Mark as move made.
|
||||
player->state |= POKER_PLAYER_STATE_ROUND_MOVE;
|
||||
// Perform the action
|
||||
pokerTurnAction(&game->poker, player, &turn);
|
||||
|
||||
// Speak
|
||||
switch(turn.type) {
|
||||
case POKER_TURN_TYPE_BET:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_RAISING;
|
||||
break;
|
||||
|
||||
case POKER_TURN_TYPE_CALL:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CALLING;
|
||||
break;
|
||||
|
||||
case POKER_TURN_TYPE_ALL_IN:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CALLING;
|
||||
break;
|
||||
|
||||
case POKER_TURN_TYPE_FOLD:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_FOLDING;
|
||||
break;
|
||||
|
||||
case POKER_TURN_TYPE_CHECK:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_PLAYER_CHECKING;
|
||||
break;
|
||||
|
||||
default:
|
||||
discussion.reason = POKER_DISCUSSION_REASON_TEST;
|
||||
break;
|
||||
}
|
||||
|
||||
discussion.poker = game;
|
||||
discussion.playerCause = game->poker.bet.better;
|
||||
pokerDiscussionQueue(&discussion);
|
||||
|
||||
// Next.
|
||||
printf("Player %i is %s.\n", game->poker.bet.better, debugAction);
|
||||
queueNext(queue);
|
||||
}
|
||||
|
||||
|
@ -32,4 +32,20 @@ pokerturn_t pokerTurnGet(poker_t *poker, uint8_t playerIndex) {
|
||||
turn.confidence = 1;
|
||||
|
||||
return turn;
|
||||
}
|
||||
|
||||
void pokerTurnAction(poker_t *poker, pokerplayer_t *player, pokerturn_t *turn) {
|
||||
switch(turn->type) {
|
||||
case POKER_TURN_TYPE_BET:
|
||||
case POKER_TURN_TYPE_CALL:
|
||||
case POKER_TURN_TYPE_ALL_IN:
|
||||
pokerBetPlayer(poker, player, turn->chips);
|
||||
break;
|
||||
|
||||
case POKER_TURN_TYPE_FOLD:
|
||||
player->state |= POKER_PLAYER_STATE_FOLDED;
|
||||
break;
|
||||
}
|
||||
|
||||
player->state |= POKER_PLAYER_STATE_ROUND_MOVE;
|
||||
}
|
@ -15,4 +15,13 @@
|
||||
* @param playerIndex Player index to get the turn for.
|
||||
* @return Some information about the move the player is trying to perform.
|
||||
*/
|
||||
pokerturn_t pokerTurnGet(poker_t *poker, uint8_t playerIndex);
|
||||
pokerturn_t pokerTurnGet(poker_t *poker, uint8_t playerIndex);
|
||||
|
||||
/**
|
||||
* Perform the turn's action.
|
||||
*
|
||||
* @param poker Poker game instance.
|
||||
* @param player Player instance.
|
||||
* @param turn Turn to action.
|
||||
*/
|
||||
void pokerTurnAction(poker_t *poker, pokerplayer_t *player, pokerturn_t *turn);
|
@ -9,10 +9,10 @@
|
||||
#include <dawn/dawn.h>
|
||||
#include "../display/shader.h"
|
||||
#include "../display/camera.h"
|
||||
#include "../display/gui/font.h"
|
||||
#include "../display/font.h"
|
||||
#include "../file/asset.h"
|
||||
|
||||
#include "../display/gui/font.h"
|
||||
#include "../display/font.h"
|
||||
#include "../display/texture.h"
|
||||
#include "../vn/vncharacter.h"
|
||||
#include "../vn/conversation/vnconversation.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "../display/shader.h"
|
||||
#include "../display/primitive.h"
|
||||
#include "../display/primitives/quad.h"
|
||||
#include "../display/gui/font.h"
|
||||
#include "../display/font.h"
|
||||
|
||||
/**
|
||||
* Initialize a GUI Frame.
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <dawn/dawn.h>
|
||||
#include "../display/shader.h"
|
||||
#include "../display/primitive.h"
|
||||
#include "../display/gui/font.h"
|
||||
#include "../display/font.h"
|
||||
|
||||
/**
|
||||
* Initialize a Label UI Element.
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "../../display/primitive.h"
|
||||
#include "../../display/shader.h"
|
||||
#include "../../display/animation/timeline.h"
|
||||
#include "../../display/gui/font.h"
|
||||
#include "../../display/font.h"
|
||||
#include "../../display/primitives/quad.h"
|
||||
#include "../../input/input.h"
|
||||
#include "../../ui/frame.h"
|
||||
|
Reference in New Issue
Block a user