room

package
v0.0.0-...-eab5728 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package room maintains the game field of vires.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Room

type Room struct {
	// contains filtered or unexported fields
}

Room represents a single entity that hosts a match.

func NewRoom

func NewRoom(id string, notifyQuit chan<- *Room) *Room

NewRoom creates a new room and launches the handler for inbound connections and starting the match.

func (*Room) Connect

func (r *Room) Connect(c *websocket.Conn)

Connect connects a user with the specified connection to the room.

func (*Room) ID

func (r *Room) ID() string

ID gets the room id.

func (*Room) StartMatch

func (r *Room) StartMatch() bool

StartMatch starts the match and returns whether the match was started or if it was already running.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL