Documentation ¶
Index ¶
- func GetSeed() (rv int64)
- func KMAC128(separator string, key, data []byte, outBits int) []byte
- type Game
- func (g *Game) Close()
- func (g *Game) DeletePlayer(name string) bool
- func (g *Game) HasPlayer(name string) bool
- func (g *Game) Hash(thing, name string) []byte
- func (g *Game) History() []string
- func (g *Game) Leaders() []LeaderInfo
- func (g *Game) ListStocks() []Stock
- func (g *Game) NewPlayer(name string) *PlayerInfo
- func (g *Game) News() []string
- func (g *Game) Player(name string) *PlayerInfo
- func (g *Game) PlayerByCookie(cookie []byte) (string, *PlayerInfo)
- func (g *Game) Run()
- type LeaderInfo
- type LeaderSort
- type PlayerHoldings
- type PlayerInfo
- func (p *PlayerInfo) Buy(stock string, lots uint64) error
- func (p *PlayerInfo) CheckPassword(pw string) bool
- func (p *PlayerInfo) ClearCookie()
- func (p *PlayerInfo) Holdings() PlayerHoldings
- func (p *PlayerInfo) IsAdmin() bool
- func (p *PlayerInfo) NewCookie() []byte
- func (p *PlayerInfo) Sell(stock string, lots uint64) error
- func (p *PlayerInfo) SetAdmin(is bool)
- func (p *PlayerInfo) SetPassword(pw string)
- type Stock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Game ¶
type Game struct {
// contains filtered or unexported fields
}
func (*Game) DeletePlayer ¶
func (*Game) Leaders ¶
func (g *Game) Leaders() []LeaderInfo
func (*Game) ListStocks ¶
func (*Game) NewPlayer ¶
func (g *Game) NewPlayer(name string) *PlayerInfo
func (*Game) Player ¶
func (g *Game) Player(name string) *PlayerInfo
func (*Game) PlayerByCookie ¶
func (g *Game) PlayerByCookie(cookie []byte) (string, *PlayerInfo)
type LeaderInfo ¶
type LeaderSort ¶
type LeaderSort []LeaderInfo
func (LeaderSort) Len ¶
func (l LeaderSort) Len() int
func (LeaderSort) Less ¶
func (l LeaderSort) Less(i, j int) bool
func (LeaderSort) Swap ¶
func (l LeaderSort) Swap(i, j int)
type PlayerHoldings ¶
type PlayerHoldings struct { Cash uint64 }
type PlayerInfo ¶
type PlayerInfo struct {
// contains filtered or unexported fields
}
func (*PlayerInfo) CheckPassword ¶
func (p *PlayerInfo) CheckPassword(pw string) bool
func (*PlayerInfo) ClearCookie ¶
func (p *PlayerInfo) ClearCookie()
func (*PlayerInfo) Holdings ¶
func (p *PlayerInfo) Holdings() PlayerHoldings
func (*PlayerInfo) IsAdmin ¶
func (p *PlayerInfo) IsAdmin() bool
func (*PlayerInfo) NewCookie ¶
func (p *PlayerInfo) NewCookie() []byte
func (*PlayerInfo) SetAdmin ¶
func (p *PlayerInfo) SetAdmin(is bool)
func (*PlayerInfo) SetPassword ¶
func (p *PlayerInfo) SetPassword(pw string)
Click to show internal directories.
Click to hide internal directories.