Dawn/src/dawn/games/poker/visualnovel/PokerDetermineBetterEvent.hpp

101 lines
2.7 KiB
C++

// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "PokerGameEvent.hpp"
namespace Dawn {
class PokerDetermineBetterEvent : public PokerGameEvent {
protected:
IVisualNovelEvent * eventEveryoneFolded = nullptr;
IVisualNovelEvent * eventBettingFinished = nullptr;
IVisualNovelEvent * eventTurn = nullptr;
IVisualNovelEvent * eventAiBet = nullptr;
IVisualNovelEvent * eventHumanBet = nullptr;
void onStart(IVisualNovelEvent *previous) override;
bool_t onUpdate() override;
void onEnd() override;
public:
/**
* Construct a better determine event.
*
* @param manager VN manager that this event belongs to.
*/
PokerDetermineBetterEvent(VisualNovelManager *manager);
/**
* Sets the event that is triggered when everyone is folded.
*
* @param event Event to trigger.
* @return The event that was passed in.
*/
template<class T>
T * whenEveryoneFolded(T *event) {
assertNotNull(event);
this->eventEveryoneFolded = event;
return event;
}
/**
* Sets the event that is triggered after everyone has finished betting.
*
* @param event Event to trigger.
* @return The event that was passed in.
*/
template<class T>
T * whenBettingFinished(T *event) {
assertNotNull(event);
this->eventBettingFinished = event;
return event;
}
/**
* Event to trigger when all betting is finished and its time to turn the
* next set of community cards.
*
* @param event Event to trigger.
* @return The event that was passed in.
*/
template<class T>
T * whenTurn(T *event) {
assertNotNull(event);
this->eventTurn = event;
return event;
}
/**
* Sets the event to trigger when its an AI's turn to bet.
*
* @param event Event to trigger.
* @return The event that was passed in.
*/
template<class T>
T * whenAiBet(T *event) {
assertNotNull(event);
this->eventAiBet = event;
return event;
}
/**
* Sets the event to trigger when its a human's turn to bet.
*
* @param event Event to trigger.
* @return The event that was passed in.
*/
template<class T>
T * whenHumanBet(T *event) {
assertNotNull(event);
this->eventHumanBet = event;
return event;
}
/**
* Dispose override for the event.
*/
~PokerDetermineBetterEvent();
};
}