Fixed some bugs with AI

This commit is contained in:
2022-11-26 14:31:06 -08:00
parent c1ac69a146
commit c1d6885970
25 changed files with 245 additions and 119 deletions

View File

@ -0,0 +1,59 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#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"
#include "poker/visualnovel/PokerAIBetEvent.hpp"
#define POKER_DEAL_EVENT_CARD_COUNT 2
namespace Dawn {
class PokerBetLoopEvent : public PokerGameEvent {
protected:
void onStart(IVisualNovelEvent *previous) override {
PokerGameEvent::onStart(previous);
std::cout << "Bet Loop, bet" << std::endl;
auto evt2 = new PokerDetermineBetterEvent(this->manager);
auto betting = this->then(evt2);
betting
->whenEveryoneFolded(new VisualNovelTextboxEvent(this->manager, "Everyone Folded"))
;
betting
->whenBettingFinished(new VisualNovelTextboxEvent(this->manager, "Betting Finished"))
;
betting
->whenTurn(new VisualNovelTextboxEvent(this->manager, "Turn Time"))
;
betting
->whenAiBet(new PokerAIBetEvent(this->manager))
->then(new VisualNovelTextboxEvent(this->manager, "AI Bet"))
->then(new PokerBetLoopEvent(this->manager))
;
betting
->whenHumanBet(new VisualNovelTextboxEvent(this->manager, "Human Bet"))
->then(new PokerBetLoopEvent(this->manager))
;
}
bool_t onUpdate() override {
return false;
}
void onEnd() override {
std::cout << "Bet lop fin" << std::endl;
}
public:
PokerBetLoopEvent(VisualNovelManager *manager) : PokerGameEvent(manager) {
}
};
}