Documentation ¶
Index ¶
- func IsInRange(players []models.Player, i int) bool
- type Lobby
- func (l *Lobby) Count() int
- func (l *Lobby) FillLobbyPosition()
- func (l *Lobby) FindPlayerByID(id string) int
- func (l *Lobby) GetGameStarted() bool
- func (l *Lobby) HasToBeAdded() bool
- func (l *Lobby) HasToBeRemoved() bool
- func (l *Lobby) Join(player *models.Player) error
- func (l *Lobby) PrepareForRound()
- func (l *Lobby) RegisterLobbyValue(class *pokerModels.Class, classIndex int, id string)
- func (l *Lobby) RemoveLeftPlayers()
- func (l *Lobby) RemovePlayer(index int) error
- func (l *Lobby) RemovePlayerByID(id string) error
- func (l *Lobby) SetPlayerCountLabel()
- func (l *Lobby) Start()
- type Once
- type RemovalRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lobby ¶
type Lobby struct { pokerModels.LobbyBase Players []models.Player PublicPlayers []models.PublicPlayer PlayerQueue *queue.PlayerQueue RemovalQueue queue.IQueue Bank bank.Interface GameStarted bool // contains filtered or unexported fields }
Lobby is the Parent structure for a poker lobby it handles the player joins and removals and the game starts.
func (*Lobby) FillLobbyPosition ¶
func (l *Lobby) FillLobbyPosition()
FillLobbyPosition recursively adds players to the lobby until the maximum of 10
func (*Lobby) FindPlayerByID ¶
FindPlayerByID searches a player based on the given id linearly.
func (*Lobby) GetGameStarted ¶
GetGameStarted determines whether a game has already in this lobby started.
func (*Lobby) HasToBeAdded ¶
HasToBeAdded determines whether there are any pending lobby joins
func (*Lobby) HasToBeRemoved ¶
HasToBeRemoved determines whether there are any pending removals
func (*Lobby) Join ¶
Join adds the player to the waiting queue and starts the queue emptying if possible.
func (*Lobby) PrepareForRound ¶
func (l *Lobby) PrepareForRound()
PrepareForRound prepares the lobby for a new Round
func (*Lobby) RegisterLobbyValue ¶
func (l *Lobby) RegisterLobbyValue(class *pokerModels.Class, classIndex int, id string)
func (*Lobby) RemoveLeftPlayers ¶
func (l *Lobby) RemoveLeftPlayers()
RemoveLeftPlayers starts the recursive removal of hanging players
func (*Lobby) RemovePlayer ¶
func (*Lobby) RemovePlayerByID ¶
RemovePlayerByID removes the given player identified by his id. (LOCKS)
func (*Lobby) SetPlayerCountLabel ¶
func (l *Lobby) SetPlayerCountLabel()
type Once ¶
type Once struct {
// contains filtered or unexported fields
}