Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a user connected to websocket
type PlayerQueue ¶
type PlayerQueue struct {
// contains filtered or unexported fields
}
PlayerQueue holds all users, who are waiting for a game.
func (*PlayerQueue) Append ¶
func (q *PlayerQueue) Append(c *Client)
Append adds user to end of queue
func (*PlayerQueue) ContainsUser ¶
func (q *PlayerQueue) ContainsUser(u entity.User) bool
ContainsUser checks if queue contains user
func (*PlayerQueue) Pop ¶
func (q *PlayerQueue) Pop() *Client
Pop removes first user from queue and returns it if queue is empty, nil is returned
func (*PlayerQueue) Size ¶
func (q *PlayerQueue) Size() int
Size returns the amount of useres in the queue
Source Files ¶
Click to show internal directories.
Click to hide internal directories.