KiTraining
 All Data Structures Functions
Public Member Functions
gameHandling::PhaseManager Class Reference

Public Member Functions

 PhaseManager (const std::shared_ptr< gameModel::Team > &team1, const std::shared_ptr< gameModel::Team > &team2, std::shared_ptr< const gameModel::Environment > env, Timeouts timeouts)
 
auto nextPlayer () -> std::optional< communication::messages::broadcast::Next >
 
auto nextInterference () -> std::optional< communication::messages::broadcast::Next >
 
bool hasInterference () const
 
void resetPlayers ()
 
void resetInterferences ()
 
void reset ()
 
int interferencesUsedLeft (communication::messages::types::FanType type) const
 
int interferencesUsedRight (communication::messages::types::FanType type) const
 
bool playerUsed (const std::shared_ptr< const gameModel::Player > &player) const
 

Member Function Documentation

bool gameHandling::PhaseManager::hasInterference ( ) const
Returns
true if at least one Team can use an Interference
int gameHandling::PhaseManager::interferencesUsedLeft ( communication::messages::types::FanType  type) const
Parameters
type
Returns
the number of times the specified fan was used (left team)
int gameHandling::PhaseManager::interferencesUsedRight ( communication::messages::types::FanType  type) const
Parameters
type
Returns
the number of times the specified fan was used (right team)
auto gameHandling::PhaseManager::nextInterference ( ) -> std::optional<communication::messages::broadcast::Next>

Returns the next Fan action required by a client

Returns
Next action to be taken, or nothing if fan phase is over
auto gameHandling::PhaseManager::nextPlayer ( ) -> std::optional<communication::messages::broadcast::Next>

Returns the next Player action required by a client

Returns
Next action to be taken, or nothing if player phase is over
bool gameHandling::PhaseManager::playerUsed ( const std::shared_ptr< const gameModel::Player > &  player) const
Parameters
player
Returns
true if the specified player already used their entire turn
void gameHandling::PhaseManager::reset ( )

Resets all internal states so that players and interferences can be selected again

void gameHandling::PhaseManager::resetInterferences ( )

Resets the internal states so that interferences can be selected again

void gameHandling::PhaseManager::resetPlayers ( )

Resets the internal states so that players can be selected again


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