This commit is contained in:
2021-09-27 22:48:28 -07:00
parent 25e683b512
commit fa54383d6f
5 changed files with 14 additions and 11 deletions

View File

@ -20,7 +20,7 @@ set(SETTING_GAME_POKER 1)
set(SETTING_GAME_DAWN 2)
set(SETTING_GAME_SANDBOX 3)
set(SETTING_GAME SETTING_GAME_POKER)
set(SETTING_GAME SETTING_GAME_DAWN)
set(SETTING_GAME_NAME "DawnGame")
################################## Targets #####################################

View File

@ -7,14 +7,14 @@
#include "dawngame.h"
bool dawnGameInit(game_t *game) {
bool dawnGameInit(dawngame_t *game) {
return true;
}
void dawnGameUpdate(game_t *game) {
void dawnGameUpdate(dawngame_t *game) {
}
void dawnGameDispose(game_t *game) {
void dawnGameDispose(dawngame_t *game) {
}

View File

@ -7,7 +7,7 @@
#pragma once
#include "../../libs.h"
#include "../game.h"
#include "../../engine/engine.h"
typedef struct {
engine_t engine;
@ -19,18 +19,18 @@ typedef struct {
* @param game Game to instanciate.
* @return True if successful otherwise false.
*/
bool dawnGameInit(game_t *game);
bool dawnGameInit(dawngame_t *game);
/**
* Update the Dawn Game Instance.
*
* @param game Game to update.
*/
void dawnGameUpdate(game_t *game);
void dawnGameUpdate(dawngame_t *game);
/**
* Cleanup the dawn game instance.
*
* @param game Game to dispose.
*/
void dawnGameDispose(game_t *game);
void dawnGameDispose(dawngame_t *game);

View File

@ -17,8 +17,11 @@
#define GAME_DISPOSE pokerGameDispose
#elif SETTING_GAME == SETTING_GAME_DAWN
#include "dawn/game.h"
#include "dawn/dawngame.h"
typedef dawngame_t game_t;
#define GAME_INIT dawnGameInit
#define GAME_UPDATE dawnGameUpdate
#define GAME_DISPOSE dawnGameDispose
#elif SETTING_GAME == SETTING_GAME_SANDBOX
#include "sandbox/sandboxscene.h"

View File

@ -138,13 +138,13 @@ pokerturn_t pokerTurnGet(poker_t *poker, uint8_t playerIndex) {
// Did we actually bet?
if(amount > 0) {
printf("I plan on betting %i chips\n", amount);
printf("AI is betting %i chips, bluff: %i\n", amount, isBluff);
// Let's not get caught in a raising loop with AI.
if(player->timesRaised >= POKER_TURN_MAX_RAISES) {
amount = callBet;
}
amount = mathMax(amount, callBet);
turn = pokerTurnRaise(poker, playerIndex, amount);
turn.confidence = confidence;