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

Public Member Functions

 MemberSelector (const std::shared_ptr< gameModel::Team > &team)
 
auto getNextPlayer () -> std::shared_ptr< gameModel::Player >
 
bool hasPlayers () const
 
bool playerUsed (communication::messages::types::EntityId id) const
 
auto getNextInterference () -> communication::messages::types::EntityId
 
bool hasInterference () const
 
int usedInterferences (communication::messages::types::FanType type) const
 
void resetPlayers ()
 
void resetInterferences ()
 
auto getSide () const -> gameModel::TeamSide
 

Member Function Documentation

auto gameHandling::MemberSelector::getNextInterference ( ) -> communication::messages::types::EntityId
Returns
the next randomly chosen interference id from the team
Exceptions
std::runtime_errorwhen all interferences from team have been selected
auto gameHandling::MemberSelector::getNextPlayer ( ) -> std::shared_ptr<gameModel::Player>
Returns
the next randomly chosen player id from the team
Exceptions
std::runtime_errorwhen all players from team have been selected
auto gameHandling::MemberSelector::getSide ( ) const -> gameModel::TeamSide

Getter

Returns
the Teamside of the managed Team
bool gameHandling::MemberSelector::hasInterference ( ) const
Returns
false if all interferences have been selected, true otherwise
bool gameHandling::MemberSelector::hasPlayers ( ) const
Returns
true if at least one Player is available
bool gameHandling::MemberSelector::playerUsed ( communication::messages::types::EntityId  id) const
Parameters
id
Returns
true if the specified PlayerID has already been selected
void gameHandling::MemberSelector::resetInterferences ( )

Restores the initial state of the interference list just as after the construction Resets the internal representation of the interference list, so that it is possible to randomly choose interferences again.

void gameHandling::MemberSelector::resetPlayers ( )

Restores the initial state of the player list just as after the construction Resets the internal representation of the player list, so that it is possible to randomly choose players again.

int gameHandling::MemberSelector::usedInterferences ( communication::messages::types::FanType  type) const
Parameters
type
Returns
the number of times the selected fan has been used

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