Documentation ¶
Index ¶
- Constants
- type ActionResult
- type FingerPoint
- type Game
- func (g *Game) AddPlayer(p player.Player) error
- func (g *Game) AliveMaxEvils() []string
- func (g *Game) Broadcast(title string, payload interface{})
- func (g *Game) Day() bool
- func (g *Game) End(victor int)
- func (g *Game) EndDay(ousted player.Player)
- func (g *Game) HandleJoins(joinChan chan player.Player)
- func (g *Game) HandlePlayerMessage()
- func (g *Game) NextPhase()
- func (g *Game) NightAction(fp *FingerPoint) *ActionResult
- func (g *Game) Parity() int
- func (g *Game) ProcessNightActionQueue()
- func (g *Game) ProcessStartActionQueue()
- func (g *Game) QueueNightAction(fp *FingerPoint)
- func (g *Game) RebuildTally()
- func (g *Game) RemovePlayer(id string)
- func (g *Game) Reset()
- func (g *Game) SetRoleset(r *roleset.Roleset) error
- func (g *Game) ShouldStart() bool
- func (g *Game) Start() error
- func (g *Game) StartAction(p player.Player) *ActionResult
- func (g *Game) UpdatePlayerList()
- func (g *Game) Vote(from player.Player, to string) error
- func (g *Game) VotedOut() player.Player
Constants ¶
View Source
const ( IsWerewolf = "IS a Werewolf!" IsNotWerewolf = "is not a Werewolf" IsSeer = "IS a Seer" IsNotSeer = "is not a Seer" IsAuxEvil = "IS a aux evil" IsNotAuxEvil = "is not aux evil" WolfListSingle = "The Werewolf is" WolfListMultiple = "The Werewolves are" )
View Source
const ( NotRunning = iota Setup = iota Running = iota Finished = iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionResult ¶
type Game ¶
type Game struct { Players map[string]player.Player `json:"-"` PlayerList []player.Player `json:"players"` Roleset *roleset.Roleset `json:"roleset"` Tally []*tally.TallyItem `json:"tally"` State int `json:"game_state"` Phase int `json:"phase"` NightActionQueue []*FingerPoint `json:"-"` // contains filtered or unexported fields }
func (*Game) AliveMaxEvils ¶
func (*Game) HandleJoins ¶
func (*Game) HandlePlayerMessage ¶
func (g *Game) HandlePlayerMessage()
func (*Game) NightAction ¶
func (g *Game) NightAction(fp *FingerPoint) *ActionResult
func (*Game) ProcessNightActionQueue ¶
func (g *Game) ProcessNightActionQueue()
func (*Game) ProcessStartActionQueue ¶
func (g *Game) ProcessStartActionQueue()
func (*Game) QueueNightAction ¶
func (g *Game) QueueNightAction(fp *FingerPoint)
func (*Game) RebuildTally ¶
func (g *Game) RebuildTally()
RebuildTally calculates the current tally based on individual votes. If there are no votes, it essentially clears it.
func (*Game) RemovePlayer ¶
func (*Game) ShouldStart ¶
func (*Game) StartAction ¶
func (g *Game) StartAction(p player.Player) *ActionResult
func (*Game) UpdatePlayerList ¶
func (g *Game) UpdatePlayerList()
Click to show internal directories.
Click to hide internal directories.