1 #ifndef GAME_BATTLES_BATTLERCONTROLLERS_BATTLERCONTROLLER_HPP
2 #define GAME_BATTLES_BATTLERCONTROLLERS_BATTLERCONTROLLER_HPP
39 virtual const std::string&
name()
const = 0;
192 std::uint8_t switchIndex;
193 bool subActionPicked;
Id
Represents an item in its simplist form.
Core classes and functionality for both the editor and game.
TurnAction
Represents an action that a battler may take on their turn.
Base class for battlers in the game. This provides storage for peoplemon and turn choices.
Base class for battlers in the game. This provides storage for peoplemon and turn choices.
virtual bool isHost() const =0
Return whether or not the controlled battler is the host.
bool shouldContinue() const
Returns whether or not the player has chosen to continue.
int chosenMove() const
Returns the move the battler is using this turn.
virtual const std::string & name() const =0
Returns the name of the battler.
void setOwner(Battler &owner)
Sets the owner of this controller.
TurnAction chosenAction() const
Returns the action the battler is using this turn.
void pickAction()
Initiates the process of selecting what to do on this turn.
virtual ~BattlerController()=default
Destroy the Battler Controller object.
void chooseGiveUp(bool yes)
Choose whether to give up or not.
bool actionSelected() const
Returns whether or not the battler has chosen what to do on this turn.
void chooseMove(int move)
Selects the move to use this turn when fighting.
virtual void refresh()=0
Method that allows controllers to poll status from non-callback based sources.
virtual void startChooseToContinue()=0
Prompts the player to continue or not.
void choosePeoplemon(std::uint8_t i)
Selects the peoplemon to switch to.
virtual bool removeItem(item::Id item)=0
Removes the item from the battler's inventory.
std::uint8_t chosenPeoplemon() const
Returns the peoplemon the battler is switching to this turn.
void chooseItem(std::uint8_t pplIndex, core::item::Id item)
Selects the item to use.
void chooseRun()
Chooses to run away.
void chooseToContinue()
Prompts the player to continue or not.
core::item::Id chosenItem() const
Returns the item the battler is using this turn.
BattlerController()
Initializes the battler with the peoplemon available to it.
void pickPeoplemon(bool fromFaint, bool reviveOnly)
Initiates the process of selecting a replacement peoplemon if the current one faints.
virtual void startChoosePeoplemon(bool fromFaint, bool reviveOnly)=0
Base classes may override this to perform specific logic when a peoplemon must be picked.
virtual void startChooseAction()=0
Base classes may override this to perform specific logic to occur when a turn is made.