Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct {
// ID is the id of the game
ID string
// Name is the name of the game given by the initiator
Name string
// Initiator is the connection of the player who started the game
Initiator *connection.Conn
// Player2 is the connection of player 2
Player2 *connection.Conn
// InitTime is the time the game object was initiated
InitTime time.Time
// Ready is true if both players are in the game
Ready bool
// USD is the connection to the Unix domain socket
UDS net.Conn
// UDSPath is the filesystem path to the unix domain socket
UDSPath string
// FinChan is the channel that will send a message when the game can be deleted
FinChan chan bool
// contains filtered or unexported fields
}
Game is a structure which handles a game
func NewGame ¶
func NewGame(initiator *connection.Conn, name string) *Game
NewGame returns a pointer to a game instance given two connections
func (*Game) Bytes ¶
Bytes returns an API friendly binary representation of the game object which can be sent to clients.
func (*Game) Identification ¶
Identification returns a human readable way of differenciating between games
type GameListMessage ¶
GameListMessage is a structure representing a Game List message
func NewGameListMessage ¶
func NewGameListMessage(allgames map[string]*Game) GameListMessage
NewGameListMessage returns an instance of GameListMessage based on params
func (*GameListMessage) Bytes ¶
func (ms *GameListMessage) Bytes() []byte
Bytes returns a slice of bytes representing a GameListMessage which can be sent through a connection
Click to show internal directories.
Click to hide internal directories.