instances

package
v0.0.0-...-c06bead Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LinkHashToRoom

func LinkHashToRoom(hash, roomName string)

Types

type GameStatus

type GameStatus int
const (
	Starting GameStatus = iota
	Started
	Paused
	Stopped
)

type Instance

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

func Create

func Create(roomName string) *Instance

func CreateInstance

func CreateInstance() *Instance

CreateInstance : Creates & Initialize a new game instance

func GetInstance

func GetInstance(roomName string) *Instance

func GetInstanceWithHash

func GetInstanceWithHash(hash string) *Instance

func (*Instance) AddPlayer

func (i *Instance) AddPlayer() int8

func (*Instance) GetGame

func (i *Instance) GetGame() *pong.Game

func (*Instance) GetNumberOfPlayersConnected

func (i *Instance) GetNumberOfPlayersConnected() int8

func (*Instance) GetRoomName

func (i *Instance) GetRoomName() string

func (*Instance) GetStatus

func (i *Instance) GetStatus() GameStatus

func (*Instance) GetTicks

func (i *Instance) GetTicks() int8

func (*Instance) KeepAlive

func (i *Instance) KeepAlive()

func (*Instance) Run

func (i *Instance) Run()

Run : runs an instance

type InstancesManager

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

func Get

func Get() *InstancesManager

func (*InstancesManager) GetInstances

func (im *InstancesManager) GetInstances() map[string]*Instance

func (*InstancesManager) NumberOfInstances

func (im *InstancesManager) NumberOfInstances() int

func (*InstancesManager) NumberOfPlayers

func (im *InstancesManager) NumberOfPlayers() int

func (*InstancesManager) RemoveStoppedInstance

func (im *InstancesManager) RemoveStoppedInstance()

Jump to

Keyboard shortcuts

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