Documentation ¶
Index ¶
- Variables
- func Abandon(tlbx app.Tlbx, gameType string, dst Game)
- func DeleteOutdated(exec func(query string, args ...interface{}), delay time.Duration, ...)
- func New(tlbx app.Tlbx, gameType string, game Game)
- type Active
- type ActiveInfo
- type Base
- type Game
- func Get(tlbx app.Tlbx, gameType string, game ID, updatedAfter *time.Time, dst Game) Game
- func Join(tlbx app.Tlbx, maxPlayers uint8, gameType string, game ID, dst Game) Game
- func Start(tlbx app.Tlbx, minPlayers uint8, randomizePlayerOrder bool, gameType string, ...) Game
- func TakeTurn(tlbx app.Tlbx, gameType string, dst Game, takeTurn func(game Game)) Game
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Eps = []*app.Endpoint{ { Description: "Get your active game info", Path: (&Active{}).Path(), Timeout: 500, MaxBodyBytes: app.KB, IsPrivate: false, GetDefaultArgs: func() interface{} { return nil }, GetExampleArgs: func() interface{} { return nil }, GetExampleResponse: func() interface{} { return &ActiveInfo{ Type: "a_game_type", ID: app.ExampleID(), } }, Handler: func(tlbx app.Tlbx, _ interface{}) interface{} { g, gameType := getUsersActiveGame(tlbx, nil, false, "", &Base{}) if g == nil { return nil } return &ActiveInfo{ Type: gameType, ID: g.GetBase().ID, } }, }, } )
Functions ¶
func DeleteOutdated ¶
Types ¶
type ActiveInfo ¶
type ActiveInfo struct { Type string `json:"type"` ID ID `json:"id"` }
type Base ¶
type Base struct { ID ID `json:"id"` UpdatedOn time.Time `json:"updatedOn"` State uint8 `json:"state"` // 0 not started, 1 started, 2 finished, 3 abandoned MyID *ID `json:"myId,omitempty"` Players IDs `json:"players"` Turn uint32 `json:"turn"` }
func (*Base) NotStarted ¶
Click to show internal directories.
Click to hide internal directories.