Documentation ¶
Index ¶
- type Alliance
- type EventListener
- type EventSystem
- func (e EventSystem) DailyVoteEvent(g *Game, event *events.DailyVoteEvent)
- func (e EventSystem) GameStartedEvent(g *Game, event *events.GameStartedEvent)
- func (e EventSystem) NightStartedEvent(g *Game, event *events.NightStartedEvent)
- func (e EventSystem) PlayerDeadEvent(g *Game, event *events.PlayerDeadEvent)
- func (e EventSystem) PlayerRevealedEvent(g *Game, event *events.PlayerRevealedEvent)
- func (e EventSystem) WerewolfVoteEvent(g *Game, event *events.WerewolfVoteEvent)
- type Game
- type Group
- type Player
- type PlayerGroup
- type Role
- type RoleFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventListener ¶
type EventListener interface { OnGameStarted(*Game, *events.GameStartedEvent) OnNightStarted(*Game, *events.NightStartedEvent) OnWerewolfVote(*Game, *events.WerewolfVoteEvent) OnDailyVote(*Game, *events.DailyVoteEvent) OnPlayerDead(*Game, *events.PlayerDeadEvent) OnPlayerRevealed(*Game, *events.PlayerRevealedEvent) }
type EventSystem ¶
type EventSystem struct { }
func NewEventSystem ¶
func NewEventSystem() *EventSystem
func (EventSystem) DailyVoteEvent ¶
func (e EventSystem) DailyVoteEvent(g *Game, event *events.DailyVoteEvent)
func (EventSystem) GameStartedEvent ¶
func (e EventSystem) GameStartedEvent(g *Game, event *events.GameStartedEvent)
func (EventSystem) NightStartedEvent ¶
func (e EventSystem) NightStartedEvent(g *Game, event *events.NightStartedEvent)
func (EventSystem) PlayerDeadEvent ¶
func (e EventSystem) PlayerDeadEvent(g *Game, event *events.PlayerDeadEvent)
func (EventSystem) PlayerRevealedEvent ¶
func (e EventSystem) PlayerRevealedEvent(g *Game, event *events.PlayerRevealedEvent)
func (EventSystem) WerewolfVoteEvent ¶
func (e EventSystem) WerewolfVoteEvent(g *Game, event *events.WerewolfVoteEvent)
type Game ¶
type Game struct { *PlayerGroup *EventSystem // contains filtered or unexported fields }
func NewGame ¶
func NewGame(group *PlayerGroup, eventSystem *EventSystem) *Game
type Player ¶
type Player struct { Role io.PlayerWriter io.PlayerReader }
func NewPlayer ¶
func NewPlayer(role Role, w io.PlayerWriter, r io.PlayerReader) *Player
type PlayerGroup ¶
type PlayerGroup struct {
// contains filtered or unexported fields
}
func (*PlayerGroup) Count ¶
func (p *PlayerGroup) Count() int
func (*PlayerGroup) Player ¶
func (p *PlayerGroup) Player(id int) *Player
type Role ¶
type Role interface { Name() string //Role name or player name? ID() int //Should Role really have identity? Player has identity SetID(int) //Same Alive() bool //Player is alive or dead, not the role SetAlive(bool) // same Die(*Game, bool) //Player dies, the role does not die. Alliance() Alliance //Should be bound to player. Alliance can possibly change SetAlliance(Alliance) //same EventListener //belongs here probably. }
Click to show internal directories.
Click to hide internal directories.