Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | List of all members
core::battle::BattleState Class Reference

Stores and represents the current state of a battle. This is the base class for local and remote battle states and provides the data storage as well as the local command queue resolution. More...

#include <BattleState.hpp>

Public Types

enum class  Stage : std::uint8_t {
  WildIntro = 0 , TrainerIntro , NetworkIntro , IntroSendInSelf ,
  IntroSendInOpponent , WaitingChoices , RoundStart , TurnStart ,
  NextBattler , RoundFinalEffectsPlayer , RoundFinalEffectsEnemy , RoundEnd ,
  PreUseItem , UsingItem , PeopleballThrown , PeopleballRocking ,
  PeopleballBrokeout , PeopleballStealFailed , CloneBallThrown , CloneBallFailed ,
  PeoplemonCloned , BeforeSwitch , Switching , AfterSwitch ,
  BeforeRun , Running , RunFailed , Attacking ,
  ResolveAfterAttackAbilities , ResolveAttackEffect , WaitingMidTurnSwitch , BeforeMidTurnSwitch ,
  MidTurnSwitching , AfterMidTurnSwitch , RoarSwitching , AfterRoarSwitch ,
  Fainting , CheckPlayerContinue , WaitingPlayerContinue , CheckFaint ,
  WaitingFaintSwitch , FaintSwitching , AfterFaintSwitch , XpAwardBegin ,
  XpAwardPeoplemonBegin , XpAwarding , LevelingUp , WaitingLearnMoveChoice ,
  WaitingForgetMoveChoice , NetworkDefeated , NetworkLost , TrainerDefeated ,
  PeoplemonCaught , Whiteout , ChoosingNickname , SavingPeoplemon ,
  Completed , NetworkDisconnect
}
 Represents all possible states in a battle. More...
 

Public Member Functions

 BattleState (Stage initialState)
 Creates a new BattleState. More...
 
void beginRound (bool playerIsFirst)
 Begins the next round of turns and sets the battler order. More...
 
Stage nextTurn ()
 Moves on to the next battler's turn. Returns the stage to transition to. More...
 
bool isFirstMover () const
 Returns whether the current mover is the first peoplemon to go this round. More...
 
BattlerlocalPlayer ()
 Returns the local player Battler. More...
 
Battlerenemy ()
 Returns the opponent Battler. More...
 
BattleractiveBattler ()
 Returns the battler that is current resolving their turn. More...
 
BattlerinactiveBattler ()
 Returns the battler who is currently not resolving their turn. More...
 
BattlerhostBattler ()
 Returns the battler that is the host. More...
 
BattlernonHostBattler ()
 Returns the battler who is not the host. More...
 
Stage currentStage () const
 Returns the current stage the battle is in. More...
 
void setStage (Stage stage)
 Sets the current stage of the battle. More...
 

Detailed Description

Stores and represents the current state of a battle. This is the base class for local and remote battle states and provides the data storage as well as the local command queue resolution.

Definition at line 18 of file BattleState.hpp.

Member Enumeration Documentation

◆ Stage

enum core::battle::BattleState::Stage : std::uint8_t
strong

Represents all possible states in a battle.

Enumerator
WildIntro 
TrainerIntro 
NetworkIntro 
IntroSendInSelf 
IntroSendInOpponent 
WaitingChoices 
RoundStart 
TurnStart 
NextBattler 
RoundFinalEffectsPlayer 
RoundFinalEffectsEnemy 
RoundEnd 
PreUseItem 
UsingItem 
PeopleballThrown 
PeopleballRocking 
PeopleballBrokeout 
PeopleballStealFailed 
CloneBallThrown 
CloneBallFailed 
PeoplemonCloned 
BeforeSwitch 
Switching 
AfterSwitch 
BeforeRun 
Running 
RunFailed 
Attacking 
ResolveAfterAttackAbilities 
ResolveAttackEffect 
WaitingMidTurnSwitch 
BeforeMidTurnSwitch 
MidTurnSwitching 
AfterMidTurnSwitch 
RoarSwitching 
AfterRoarSwitch 
Fainting 
CheckPlayerContinue 
WaitingPlayerContinue 
CheckFaint 
WaitingFaintSwitch 
FaintSwitching 
AfterFaintSwitch 
XpAwardBegin 
XpAwardPeoplemonBegin 
XpAwarding 
LevelingUp 
WaitingLearnMoveChoice 
WaitingForgetMoveChoice 
NetworkDefeated 
NetworkLost 
TrainerDefeated 
PeoplemonCaught 
Whiteout 
ChoosingNickname 
SavingPeoplemon 
Completed 
NetworkDisconnect 

Definition at line 24 of file BattleState.hpp.

Constructor & Destructor Documentation

◆ BattleState()

core::battle::BattleState::BattleState ( Stage  initialState)

Creates a new BattleState.

Parameters
initialStateThe initial stage to start with. Must be an intro stage

Definition at line 7 of file BattleState.cpp.

Member Function Documentation

◆ activeBattler()

Battler & core::battle::BattleState::activeBattler ( )

Returns the battler that is current resolving their turn.

Definition at line 30 of file BattleState.cpp.

◆ beginRound()

void core::battle::BattleState::beginRound ( bool  playerIsFirst)

Begins the next round of turns and sets the battler order.

Parameters
playerIsFirstTrue if the local player goes first

Definition at line 14 of file BattleState.cpp.

◆ currentStage()

BattleState::Stage core::battle::BattleState::currentStage ( ) const

Returns the current stage the battle is in.

Definition at line 42 of file BattleState.cpp.

◆ enemy()

Battler & core::battle::BattleState::enemy ( )

Returns the opponent Battler.

Definition at line 28 of file BattleState.cpp.

◆ hostBattler()

Battler & core::battle::BattleState::hostBattler ( )

Returns the battler that is the host.

Definition at line 38 of file BattleState.cpp.

◆ inactiveBattler()

Battler & core::battle::BattleState::inactiveBattler ( )

Returns the battler who is currently not resolving their turn.

Definition at line 34 of file BattleState.cpp.

◆ isFirstMover()

bool core::battle::BattleState::isFirstMover ( ) const

Returns whether the current mover is the first peoplemon to go this round.

Definition at line 46 of file BattleState.cpp.

◆ localPlayer()

Battler & core::battle::BattleState::localPlayer ( )

Returns the local player Battler.

Definition at line 26 of file BattleState.cpp.

◆ nextTurn()

BattleState::Stage core::battle::BattleState::nextTurn ( )

Moves on to the next battler's turn. Returns the stage to transition to.

Returns
Stage Either WaitingChoices or TurnStart

Definition at line 21 of file BattleState.cpp.

◆ nonHostBattler()

Battler & core::battle::BattleState::nonHostBattler ( )

Returns the battler who is not the host.

Definition at line 40 of file BattleState.cpp.

◆ setStage()

void core::battle::BattleState::setStage ( Stage  stage)

Sets the current stage of the battle.

Parameters
stageThe new battle stage

Definition at line 44 of file BattleState.cpp.


The documentation for this class was generated from the following files: