Documentation ¶
Index ¶
Constants ¶
View Source
const BadPlayerInputErrMsg = "Bad value received for number of players, please try again with a number"
View Source
const BadWinnerInputErrMsg = "invalid winner input, expect format of 'PlayerName wins'"
View Source
const PlayerPrompt = "Please enter the number of players: "
Variables ¶
This section is empty.
Functions ¶
func StdOutAlerter ¶
Types ¶
type BlindAlerter ¶
type BlindAlerterFunc ¶
func (BlindAlerterFunc) ScheduleAlertAt ¶
func (a BlindAlerterFunc) ScheduleAlertAt(duration time.Duration, amount int)
type FileSystemStore ¶
type FileSystemStore struct {
// contains filtered or unexported fields
}
func FileSystemPlayerStoreFromFile ¶
func FileSystemPlayerStoreFromFile(path string) (*FileSystemStore, error)
func NewFileSystemStore ¶
func NewFileSystemStore(database *os.File) (*FileSystemStore, error)
func (*FileSystemStore) GetLeague ¶
func (f *FileSystemStore) GetLeague() League
func (*FileSystemStore) GetPlayerScore ¶
func (f *FileSystemStore) GetPlayerScore(name string) int
func (*FileSystemStore) RecordWin ¶
func (f *FileSystemStore) RecordWin(name string)
type InMemoryPlayerStore ¶
type InMemoryPlayerStore struct {
// contains filtered or unexported fields
}
func NewInMemoryPlayerStore ¶
func NewInMemoryPlayerStore() *InMemoryPlayerStore
func (*InMemoryPlayerStore) GetLeague ¶
func (i *InMemoryPlayerStore) GetLeague() League
func (*InMemoryPlayerStore) GetPlayerScore ¶
func (i *InMemoryPlayerStore) GetPlayerScore(name string) int
func (*InMemoryPlayerStore) RecordWin ¶
func (i *InMemoryPlayerStore) RecordWin(name string)
type PlayerServer ¶
func NewPlayerServer ¶
func NewPlayerServer(store PlayerStore) *PlayerServer
func (*PlayerServer) GetPlayerScore ¶
func (p *PlayerServer) GetPlayerScore(name string) int
type PlayerStore ¶
type TexasHoldem ¶
type TexasHoldem struct {
// contains filtered or unexported fields
}
func NewTexasHoldem ¶
func NewTexasHoldem(alerter BlindAlerter, store PlayerStore) *TexasHoldem
func (*TexasHoldem) Finish ¶
func (p *TexasHoldem) Finish(winner string)
func (*TexasHoldem) Start ¶
func (p *TexasHoldem) Start(numberOfPlayers int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.