Versions in this module Expand all Collapse all v0 v0.2.1 Aug 23, 2023 v0.2.0 Aug 21, 2023 Changes in this version + func ValidRoles(roles []Role) error + type ActEndedEvent struct + Next string + Player Player + Success bool + type AlreadyVotedEvent struct + User int64 + type EventOutput interface + HandleActEnded func(ActEndedEvent) + HandleAlreadyVoted func(AlreadyVotedEvent) + HandleFirstDay func(FirstDayEvent) + HandleNightAct func(NightActEvent) + HandleNightEnded func(NightEndedEvent) + HandleNightStarted func(NightStartedEvent) + HandleNotifyStopGame func(NotifyStopGameEvent) + HandleUnableToVote func(UnableToVoteEvent) + HandleUnexpectedActTrial func(UnexpectedActTrialEvent) + HandleUnsupportedAct func(UnsupportedActEvent) + HandleVotingEnded func(VotingEndedEvent) + HandleVotingStarted func(VotingStartedEvent) + HandleWin func(WinEvent) + type FirstDayEvent struct + Players []Player + UserToNick map[int64]string + type Game struct + GActive *gameActive + NickToUser map[string]int64 + Roles []Role + UserToNick map[int64]string + func NewGame(eOutput EventOutput, code int, creator int64, roles []Role, close func(*Game)) *Game + func (g *Game) AddMember(user int64, nick string) error + func (g *Game) GetUsers() (users []int64) + func (g *Game) RandomPlayerQueue() []Player + func (g *Game) Start(pQueue []Player) error + func (g *Game) Started() bool + func (g *Game) StopGame(notify bool) + type NightActEvent struct + MafiaAlive bool + Player Player + Victims []string + type NightEndedEvent struct + Died []string + Users []int64 + type NightStartedEvent struct + FirstToWake string + Users []int64 + type NotifyStopGameEvent struct + Users []int64 + type Player struct + Role Role + User int64 + type Role int + const Doctor + const Guesser + const Mafia + const Maniac + const Peaceful + const Sheriff + const Witness + type Side int + const GuesserSide + const MafiaSide + const ManiacSide + const PeacefulSide + type UnableToVoteEvent struct + User int64 + type UnexpectedActTrialEvent struct + User int64 + type UnsupportedActEvent struct + User int64 + type VotingEndedEvent struct + Candidate int64 + UserToNick map[int64]string + UserToVoted map[int64]int64 + Users []int64 + Witness bool + type VotingStartedEvent struct + UserToCandidates map[int64][]string + type WinEvent struct + Side Side + Users []int64 + Winners []string