roles

package
v0.0.0-...-4a4c412 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2017 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UNDEFINED     = "Undefined"
	VILLAGER      = "Villager"
	WEREWOLF      = "Werewolf"
	HUNTER        = "Hunter"
	HEALER        = "Healer"
	VILLAGE_ELDER = "Village Elder"
	WITCH         = "Witch"
	CUPID         = "Cupid"
	SEER          = "Seer"
	SLUT          = "Slut"
)

Variables

This section is empty.

Functions

func Alive

func Alive(g *game.Game, i int) bool

func InBounds

func InBounds(g *game.Game, i int) bool

func NewState

func NewState(id int) *state

func NotEqual

func NotEqual(g *game.Game, i int, j int) bool

Types

type BaseRole

type BaseRole struct {
	// contains filtered or unexported fields
}

func (BaseRole) Alive

func (s BaseRole) Alive() bool

func (BaseRole) Alliance

func (s BaseRole) Alliance() game.Alliance

func (*BaseRole) Die

func (b *BaseRole) Die(g *game.Game, werewolves bool)

func (BaseRole) ID

func (s BaseRole) ID() int

func (*BaseRole) Name

func (b *BaseRole) Name() string

func (*BaseRole) OnDailyVote

func (b *BaseRole) OnDailyVote(g *game.Game, e *events.DailyVoteEvent)

func (*BaseRole) OnGameStarted

func (b *BaseRole) OnGameStarted(g *game.Game, e *events.GameStartedEvent)

func (*BaseRole) OnNightStarted

func (b *BaseRole) OnNightStarted(g *game.Game, e *events.NightStartedEvent)

func (*BaseRole) OnPlayerDead

func (b *BaseRole) OnPlayerDead(g *game.Game, e *events.PlayerDeadEvent)

func (*BaseRole) OnPlayerRevealed

func (b *BaseRole) OnPlayerRevealed(g *game.Game, e *events.PlayerRevealedEvent)

func (*BaseRole) OnWerewolfVote

func (b *BaseRole) OnWerewolfVote(g *game.Game, e *events.WerewolfVoteEvent)

func (BaseRole) SetAlive

func (s BaseRole) SetAlive(alive bool)

func (BaseRole) SetAlliance

func (s BaseRole) SetAlliance(alliance game.Alliance)

func (BaseRole) SetID

func (s BaseRole) SetID(id int)

type Cupid

type Cupid struct {
	*BaseRole
	// contains filtered or unexported fields
}

func (Cupid) Alive

func (s Cupid) Alive() bool

func (Cupid) Alliance

func (s Cupid) Alliance() game.Alliance

func (Cupid) ID

func (s Cupid) ID() int

func (*Cupid) Name

func (c *Cupid) Name() string

func (*Cupid) OnGameStarted

func (c *Cupid) OnGameStarted(g *game.Game, e *events.GameStartedEvent)

func (*Cupid) OnPlayerRevealed

func (c *Cupid) OnPlayerRevealed(g *game.Game, e *events.PlayerRevealedEvent)

func (Cupid) SetAlive

func (s Cupid) SetAlive(alive bool)

func (Cupid) SetAlliance

func (s Cupid) SetAlliance(alliance game.Alliance)

func (Cupid) SetID

func (s Cupid) SetID(id int)

type Healer

type Healer struct {
	*BaseRole
	// contains filtered or unexported fields
}

func (Healer) Alive

func (s Healer) Alive() bool

func (Healer) Alliance

func (s Healer) Alliance() game.Alliance

func (Healer) ID

func (s Healer) ID() int

func (*Healer) Name

func (h *Healer) Name() string

func (*Healer) OnNightStarted

func (h *Healer) OnNightStarted(g *game.Game, e *events.NightStartedEvent)

func (*Healer) OnPlayerDead

func (h *Healer) OnPlayerDead(g *game.Game, e *events.PlayerDeadEvent)

func (Healer) SetAlive

func (s Healer) SetAlive(alive bool)

func (Healer) SetAlliance

func (s Healer) SetAlliance(alliance game.Alliance)

func (Healer) SetID

func (s Healer) SetID(id int)

type Hunter

type Hunter struct {
	*BaseRole
}

func (Hunter) Alive

func (s Hunter) Alive() bool

func (Hunter) Alliance

func (s Hunter) Alliance() game.Alliance

func (Hunter) ID

func (s Hunter) ID() int

func (*Hunter) Name

func (h *Hunter) Name() string

func (*Hunter) OnPlayerRevealed

func (h *Hunter) OnPlayerRevealed(g *game.Game, e *events.PlayerRevealedEvent)

func (Hunter) SetAlive

func (s Hunter) SetAlive(alive bool)

func (Hunter) SetAlliance

func (s Hunter) SetAlliance(alliance game.Alliance)

func (Hunter) SetID

func (s Hunter) SetID(id int)

type RoleFactory

type RoleFactory struct {
}

func NewFactory

func NewFactory() RoleFactory

func (RoleFactory) New

func (r RoleFactory) New(role string, id int) (game.Role, error)

type Seer

type Seer struct {
	*BaseRole
}

func (Seer) Alive

func (s Seer) Alive() bool

func (Seer) Alliance

func (s Seer) Alliance() game.Alliance

func (Seer) ID

func (s Seer) ID() int

func (*Seer) Name

func (s *Seer) Name() string

func (*Seer) OnNightStarted

func (s *Seer) OnNightStarted(g *game.Game, e *events.NightStartedEvent)

func (Seer) SetAlive

func (s Seer) SetAlive(alive bool)

func (Seer) SetAlliance

func (s Seer) SetAlliance(alliance game.Alliance)

func (Seer) SetID

func (s Seer) SetID(id int)

type Slut

type Slut struct {
	*BaseRole
	// contains filtered or unexported fields
}

func (Slut) Alive

func (s Slut) Alive() bool

func (Slut) Alliance

func (s Slut) Alliance() game.Alliance

func (Slut) ID

func (s Slut) ID() int

func (*Slut) Name

func (s *Slut) Name() string

func (*Slut) OnNightStarted

func (s *Slut) OnNightStarted(g *game.Game, e *events.NightStartedEvent)

func (*Slut) OnPlayerDead

func (s *Slut) OnPlayerDead(g *game.Game, e *events.PlayerDeadEvent)

func (Slut) SetAlive

func (s Slut) SetAlive(alive bool)

func (Slut) SetAlliance

func (s Slut) SetAlliance(alliance game.Alliance)

func (Slut) SetID

func (s Slut) SetID(id int)

type VillageElder

type VillageElder struct {
	*BaseRole
	// contains filtered or unexported fields
}

func (VillageElder) Alive

func (s VillageElder) Alive() bool

func (VillageElder) Alliance

func (s VillageElder) Alliance() game.Alliance

func (VillageElder) ID

func (s VillageElder) ID() int

func (*VillageElder) Name

func (v *VillageElder) Name() string

func (*VillageElder) OnPlayerDead

func (v *VillageElder) OnPlayerDead(g *game.Game, e *events.PlayerDeadEvent)

func (VillageElder) SetAlive

func (s VillageElder) SetAlive(alive bool)

func (VillageElder) SetAlliance

func (s VillageElder) SetAlliance(alliance game.Alliance)

func (VillageElder) SetID

func (s VillageElder) SetID(id int)

type Villager

type Villager struct {
	*BaseRole
}

func (Villager) Alive

func (s Villager) Alive() bool

func (Villager) Alliance

func (s Villager) Alliance() game.Alliance

func (Villager) ID

func (s Villager) ID() int

func (*Villager) Name

func (v *Villager) Name() string

func (Villager) SetAlive

func (s Villager) SetAlive(alive bool)

func (Villager) SetAlliance

func (s Villager) SetAlliance(alliance game.Alliance)

func (Villager) SetID

func (s Villager) SetID(id int)

type Werewolf

type Werewolf struct {
	*BaseRole
}

func (Werewolf) Alive

func (s Werewolf) Alive() bool

func (Werewolf) Alliance

func (s Werewolf) Alliance() game.Alliance

func (Werewolf) ID

func (s Werewolf) ID() int

func (*Werewolf) Name

func (w *Werewolf) Name() string

func (*Werewolf) OnWerewolfVote

func (w *Werewolf) OnWerewolfVote(g *game.Game, e *events.WerewolfVoteEvent)

func (Werewolf) SetAlive

func (s Werewolf) SetAlive(alive bool)

func (Werewolf) SetAlliance

func (s Werewolf) SetAlliance(alliance game.Alliance)

func (Werewolf) SetID

func (s Werewolf) SetID(id int)

type Witch

type Witch struct {
	*BaseRole
	// contains filtered or unexported fields
}

func (Witch) Alive

func (s Witch) Alive() bool

func (Witch) Alliance

func (s Witch) Alliance() game.Alliance

func (Witch) ID

func (s Witch) ID() int

func (*Witch) Name

func (w *Witch) Name() string

func (*Witch) OnPlayerDead

func (w *Witch) OnPlayerDead(g *game.Game, e *events.PlayerDeadEvent)

func (Witch) SetAlive

func (s Witch) SetAlive(alive bool)

func (Witch) SetAlliance

func (s Witch) SetAlliance(alliance game.Alliance)

func (Witch) SetID

func (s Witch) SetID(id int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL