Documentation ¶
Index ¶
- type MessageID
- type PigGameData
- func (pg *PigGameData) GameOver() bool
- func (pg *PigGameData) Hold()
- func (pg *PigGameData) NextPlayer()
- func (pg *PigGameData) Play(id StrategyID) (keepPlaying bool)
- func (pg *PigGameData) PlayerScore(id PlayerID) int
- func (pg *PigGameData) PrintStatus(id MessageID)
- func (pg *PigGameData) Winner() PlayerID
- type PlayerID
- type StrategyID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PigGameData ¶
type PigGameData struct {
// contains filtered or unexported fields
}
func New ¶
func New() *PigGameData
Creates an intializes a new PigGameData structure, returns a *PigGameData
func (*PigGameData) Hold ¶
func (pg *PigGameData) Hold()
func (*PigGameData) NextPlayer ¶
func (pg *PigGameData) NextPlayer()
func (*PigGameData) Play ¶
func (pg *PigGameData) Play(id StrategyID) (keepPlaying bool)
Play a given strategy
func (*PigGameData) PlayerScore ¶
func (pg *PigGameData) PlayerScore(id PlayerID) int
Get the score for a given player
func (*PigGameData) PrintStatus ¶
func (pg *PigGameData) PrintStatus(id MessageID)
Print a status message, if pg.Verbose is true
func (*PigGameData) Winner ¶
func (pg *PigGameData) Winner() PlayerID
Returns the Player ID if there is a winner, or -1
type StrategyID ¶
type StrategyID int
Click to show internal directories.
Click to hide internal directories.