Progress on poker logic

This commit is contained in:
2022-11-20 22:18:50 -08:00
parent 4eeecced2f
commit 5762f12841
31 changed files with 1779 additions and 222 deletions

View File

@ -10,6 +10,13 @@
#include "ui/PokerGameTextbox.hpp"
#include "visualnovel/VisualNovelManager.hpp"
#include "visualnovel/events/VisualNovelTextboxEvent.hpp"
#include "poker/PokerGame.hpp"
#include "poker/visualnovel/PokerNewGameEvent.hpp"
#include "poker/visualnovel/PokerNewRoundEvent.hpp"
#include "poker/visualnovel/PokerTakeBlindsEvent.hpp"
#include "poker/visualnovel/PokerDealEvent.hpp"
#include "poker/visualnovel/PokerTurnEvent.hpp"
#include "poker/visualnovel/PokerDetermineBetterEvent.hpp"
namespace Dawn {
class TestScene {
@ -26,12 +33,44 @@ namespace Dawn {
auto textbox = PokerGameTextbox::create(canvas);
// VN Manager
auto item = scene->createSceneItem();
auto vnManager = item->addComponent<VisualNovelManager>();
auto vnManagerItem = scene->createSceneItem();
auto vnManager = vnManagerItem->addComponent<VisualNovelManager>();
vnManager
->setEvent(new VisualNovelTextboxEvent(vnManager, "Bruh event"))
->then(new VisualNovelTextboxEvent(vnManager, "Bruh event 2"))
// Poker Test
auto pokerGameItem = scene->createSceneItem();
auto pokerGame = pokerGameItem->addComponent<PokerGame>();
for(int32_t i = 0; i < 4; i++) {
auto pokerPlayerInstance = scene->createSceneItem();
auto pokerPlayer = pokerPlayerInstance->addComponent<PokerPlayer>();
}
auto betting = vnManager
->setEvent(new VisualNovelTextboxEvent(vnManager, "Starting Game"))
->then(new PokerNewGameEvent(vnManager))
->then(new VisualNovelTextboxEvent(vnManager, "Game Started"))
->then(new PokerNewRoundEvent(vnManager))
->then(new VisualNovelTextboxEvent(vnManager, "Round Started"))
->then(new PokerTakeBlindsEvent(vnManager))
->then(new VisualNovelTextboxEvent(vnManager, "Blinds Taken"))
->then(new PokerDealEvent(vnManager))
->then(new VisualNovelTextboxEvent(vnManager, "Cards Dealt"))
->then(new PokerDetermineBetterEvent(vnManager))
;
betting
->whenEveryoneFolded(new VisualNovelTextboxEvent(vnManager, "Everyone Folded"))
;
betting
->whenBettingFinished(new VisualNovelTextboxEvent(vnManager, "Betting Finished"))
;
betting
->whenTurn(new VisualNovelTextboxEvent(vnManager, "Turn Time"))
;
betting
->whenAiBet(new VisualNovelTextboxEvent(vnManager, "AI Bet"))
;
betting
->whenHumanBet(new VisualNovelTextboxEvent(vnManager, "Human Bet"))
;
return scene;