Documentation
¶
Index ¶
- Variables
- func NewId() string
- type Client
- type Clients
- type Game
- func (g *Game) Add(username string, conn *websocket.Conn) (int, error)
- func (g *Game) BroadCast()
- func (g *Game) Code() string
- func (g *Game) KillBroadCast()
- func (g *Game) Publish(event string)
- func (g *Game) PublishClients()
- func (g *Game) PublishFromUser(userId int, char string)
- func (g *Game) PublishStart()
- func (g *Game) RemoveClients(toRemove Clients)
- func (g *Game) Start()
- type GameRepository
- type Games
- type KillChannel
- type MessageChannel
- type Status
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var RandomNames = []string{
"Washington",
"Harun al-Rashid",
"Ashurbanipal",
"Maria Theresa",
"Montezuma",
"Nebuchadnezzar II",
"Pedro II",
"Theodora",
"Dido",
"Boudicca",
"Wu Zetian",
"Harald Bluetooth",
"Ramesses II",
"Elizabeth",
"Haile Selassie",
"Napoleon",
"Bismarck",
"Alexander",
"Attila",
"Pachacuti",
"Gandhi",
"Gajah Mada",
"Hiawatha",
"Oda Nobunaga",
"Sejong",
"Pacal",
"Genghis Khan",
"Ahmad al-Mansur",
"William",
"Suleiman",
"Darius I",
"Casimir III",
"Kamehameha",
"Maria I",
"Augustus Caesar",
"Catherine",
"Pocatello",
"Ramkhamhaeng",
"Askia",
"Tercio",
"Gustavus Adolphus",
"Enrico Dandolo",
"Shaka",
}
View Source
var Repository = &GameRepository{Games: Games{}, Mutex: sync.Mutex{}}
View Source
var SampleFiles []string
Functions ¶
Types ¶
type Game ¶
type Game struct { Id string Status Clients MessageChannel KillChannel CodeFile string }
func (*Game) KillBroadCast ¶
func (g *Game) KillBroadCast()
func (*Game) PublishClients ¶
func (g *Game) PublishClients()
func (*Game) PublishFromUser ¶
func (*Game) PublishStart ¶
func (g *Game) PublishStart()
func (*Game) RemoveClients ¶
type GameRepository ¶
func (*GameRepository) Create ¶
func (gs *GameRepository) Create() *Game
func (*GameRepository) Delete ¶
func (gs *GameRepository) Delete(g *Game)
func (*GameRepository) Find ¶
func (gs *GameRepository) Find(id string) *Game
func (*GameRepository) RandomJoinable ¶
func (gs *GameRepository) RandomJoinable() *Game
type KillChannel ¶
type KillChannel chan bool
type MessageChannel ¶
type MessageChannel chan string
Click to show internal directories.
Click to hide internal directories.