Documentation ¶
Index ¶
- Constants
- func ActivateBaldr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateBragi(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateBrunhild(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateFreyja(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateFreyr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateFrigg(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateHeimdall(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateHel(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateIdun(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateLoki(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateMimir(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateOdin(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateSkadi(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateSkuld(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateThor(_ *ServerGame, _ *ServerPlayer, opponent *ServerPlayer, god *God, level int)
- func ActivateThrymr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateTyr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateUllr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateVar(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- func ActivateVidar(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, ...)
- type God
- type GodActivation
- type GodChoice
- type Player
- type PlayerDice
- type PlayerDie
- type Power
- type ServerDie
- type ServerFace
- type ServerGame
- func (g *ServerGame) AddPlayer(conn *websocket.Conn, name string, godIndexes [3]int) error
- func (g *ServerGame) ChangePlayersPosition()
- func (g *ServerGame) ComputeRound() cmn.PlayerMap[cmn.UpdateGamePlayer]
- func (g *ServerGame) GetGodsDefinition() []cmn.InitGod
- func (g *ServerGame) GetOpponentName(you string) string
- func (g *ServerGame) GetRollDiceState() cmn.PlayerMap[cmn.DiceState]
- func (g *ServerGame) GetStartingDefinition() (cmn.PlayerMap[cmn.InitGamePlayer], []cmn.InitGameDie)
- func (g *ServerGame) GetTurn() int
- func (g *ServerGame) IsGameFinished() bool
- func (g *ServerGame) IsGameReady() bool
- func (g *ServerGame) Restart()
- func (g *ServerGame) SelectFirstPlayer()
- type ServerPlayer
- func (sp *ServerPlayer) AttackPlayer(dices [6]ServerDie, player *ServerPlayer) (int, int)
- func (sp *ServerPlayer) GainTokens(dices [6]ServerDie) int
- func (sp *ServerPlayer) GetDice() PlayerDice
- func (p *ServerPlayer) GetGodChoice() *GodChoice
- func (sp *ServerPlayer) GetGods() [3]int
- func (sp *ServerPlayer) GetHealth() int
- func (sp *ServerPlayer) GetTokens() int
- func (sp *ServerPlayer) GetUsername() string
- func (sp *ServerPlayer) Reset()
- func (sp *ServerPlayer) ResetDice()
- func (sp *ServerPlayer) RollDice()
- func (sp *ServerPlayer) SelectGod(godIndex int, godLevel int)
- func (sp *ServerPlayer) StealTokens(dices [6]ServerDie, player *ServerPlayer) int
Constants ¶
View Source
const ( Shield = "🛡" Helmet = "🪖" Arrow = "🏹" Axe = "🪓" Thief = "👌" )
Variables ¶
This section is empty.
Functions ¶
func ActivateBaldr ¶
func ActivateBaldr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateBragi ¶
func ActivateBragi(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateBrunhild ¶
func ActivateBrunhild(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateFreyja ¶
func ActivateFreyja(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateFreyr ¶
func ActivateFreyr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateFrigg ¶
func ActivateFrigg(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateHeimdall ¶
func ActivateHeimdall(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateHel ¶
func ActivateHel(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateIdun ¶
func ActivateIdun(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateLoki ¶
func ActivateLoki(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateMimir ¶
func ActivateMimir(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateOdin ¶
func ActivateOdin(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateSkadi ¶
func ActivateSkadi(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateSkuld ¶
func ActivateSkuld(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateThor ¶
func ActivateThor(_ *ServerGame, _ *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateThrymr ¶
func ActivateThrymr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateTyr ¶
func ActivateTyr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateUllr ¶
func ActivateUllr(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateVar ¶
func ActivateVar(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
func ActivateVidar ¶
func ActivateVidar(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
Types ¶
type God ¶
type GodActivation ¶
type GodActivation func(game *ServerGame, self *ServerPlayer, opponent *ServerPlayer, god *God, level int)
type PlayerDice ¶
type PlayerDice [6]*PlayerDie
type PlayerDie ¶
type PlayerDie struct {
// contains filtered or unexported fields
}
func NewPlayerDie ¶
func NewPlayerDie() *PlayerDie
func (*PlayerDie) GetFaceIndex ¶
func (*PlayerDie) GetQuantity ¶
type ServerDie ¶
type ServerDie struct {
// contains filtered or unexported fields
}
func (ServerDie) GetFaces ¶
func (d ServerDie) GetFaces() [6]ServerFace
type ServerFace ¶
type ServerFace struct {
// contains filtered or unexported fields
}
func (ServerFace) GetKind ¶
func (f ServerFace) GetKind() string
func (ServerFace) IsMagic ¶
func (f ServerFace) IsMagic() bool
type ServerGame ¶
type ServerGame struct { Uuid string Rolls int Dice [6]ServerDie Players cmn.PlayerMap[*ServerPlayer] PlayersOrder []string Gods []*God // contains filtered or unexported fields }
func NewServerGame ¶
func NewServerGame() (*ServerGame, error)
func (*ServerGame) ChangePlayersPosition ¶
func (g *ServerGame) ChangePlayersPosition()
func (*ServerGame) ComputeRound ¶
func (g *ServerGame) ComputeRound() cmn.PlayerMap[cmn.UpdateGamePlayer]
func (*ServerGame) GetGodsDefinition ¶
func (g *ServerGame) GetGodsDefinition() []cmn.InitGod
func (*ServerGame) GetOpponentName ¶
func (g *ServerGame) GetOpponentName(you string) string
func (*ServerGame) GetRollDiceState ¶
func (g *ServerGame) GetRollDiceState() cmn.PlayerMap[cmn.DiceState]
func (*ServerGame) GetStartingDefinition ¶
func (g *ServerGame) GetStartingDefinition() (cmn.PlayerMap[cmn.InitGamePlayer], []cmn.InitGameDie)
func (*ServerGame) GetTurn ¶
func (g *ServerGame) GetTurn() int
func (*ServerGame) IsGameFinished ¶
func (g *ServerGame) IsGameFinished() bool
func (*ServerGame) IsGameReady ¶
func (g *ServerGame) IsGameReady() bool
func (*ServerGame) Restart ¶
func (g *ServerGame) Restart()
func (*ServerGame) SelectFirstPlayer ¶
func (g *ServerGame) SelectFirstPlayer()
type ServerPlayer ¶
type ServerPlayer struct { Conn *websocket.Conn Expected []c.Command // contains filtered or unexported fields }
func NewServerPlayer ¶
func NewServerPlayer(conn *websocket.Conn, username string, godIndexes [3]int) *ServerPlayer
func (*ServerPlayer) AttackPlayer ¶
func (sp *ServerPlayer) AttackPlayer(dices [6]ServerDie, player *ServerPlayer) (int, int)
func (*ServerPlayer) GainTokens ¶
func (sp *ServerPlayer) GainTokens(dices [6]ServerDie) int
func (*ServerPlayer) GetDice ¶
func (sp *ServerPlayer) GetDice() PlayerDice
func (*ServerPlayer) GetGodChoice ¶
func (p *ServerPlayer) GetGodChoice() *GodChoice
func (*ServerPlayer) GetGods ¶
func (sp *ServerPlayer) GetGods() [3]int
func (*ServerPlayer) GetHealth ¶
func (sp *ServerPlayer) GetHealth() int
func (*ServerPlayer) GetTokens ¶
func (sp *ServerPlayer) GetTokens() int
func (*ServerPlayer) GetUsername ¶
func (sp *ServerPlayer) GetUsername() string
func (*ServerPlayer) Reset ¶
func (sp *ServerPlayer) Reset()
func (*ServerPlayer) ResetDice ¶
func (sp *ServerPlayer) ResetDice()
func (*ServerPlayer) RollDice ¶
func (sp *ServerPlayer) RollDice()
func (*ServerPlayer) SelectGod ¶
func (sp *ServerPlayer) SelectGod(godIndex int, godLevel int)
func (*ServerPlayer) StealTokens ¶
func (sp *ServerPlayer) StealTokens(dices [6]ServerDie, player *ServerPlayer) int
Click to show internal directories.
Click to hide internal directories.