#include <MemberSelector.h>
Implements a pseudo queue for selecting players and fans from a team
| auto gameHandling::MemberSelector::getNextInterference |
( |
| ) |
-> communication::messages::types::EntityId |
Get the next Interference from the queue
- Exceptions
-
| std::runtime_error | when all interferences from team have been selected |
- Returns
- the next randomly chosen interference id from the team
| auto gameHandling::MemberSelector::getNextPlayer |
( |
| ) |
-> std::shared_ptr<gameModel::Player> |
Get the next player from the queue
- Exceptions
-
| std::runtime_error | when all players from team have been selected |
- Returns
- the next randomly chosen player id from the team
| auto gameHandling::MemberSelector::getSide |
( |
| ) |
const -> gameModel::TeamSide |
Getter
- Returns
- the Teamside of the managed Team
| bool gameHandling::MemberSelector::hasInterference |
( |
| ) |
const |
Checks if there are still Interferences left in the queue
- Returns
- false if all interferences have been selected, true otherwise
| bool gameHandling::MemberSelector::hasPlayers |
( |
| ) |
const |
Checks if there are still Players left in the queue
- Returns
- true if at least one Player is available
| bool gameHandling::MemberSelector::playerUsed |
( |
communication::messages::types::EntityId |
id | ) |
const |
Checks if the player has been used
- Parameters
-
- 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 |
Gets the number of times the selected fan has been used
- Parameters
-
| type | The type of Interference as FanType |
- Returns
- the number of times the selected fan has been used
The documentation for this class was generated from the following files:
- /home/travis/build/SoPra-Team-10/Server/src/Game/MemberSelector.h
- /home/travis/build/SoPra-Team-10/Server/src/Game/MemberSelector.cpp