Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultChamber []bool = []bool{} DefaultNumChamber int = 6 DefaultNumBullet int = 1 DefaultNumBulletsLeft int = 1 DefaultCurrentChamber int = 0 )
Functions ¶
This section is empty.
Types ¶
type GameSettings ¶
type GameSettings struct { Opponents map[string]Player TableState TableState GunState GunState GameAccepted bool `json:"game_accepted,omitempty"` SpinChamberRule bool `json:"spin_chamber,omitempty"` SpinChamberOnShotRule bool `json:"spin_chamber_on_shot,omitempty"` ReplaceBulletRule bool `json:"replace_bullet,omitempty"` Channel string `json:"channel,omitempty"` }
var DefaultGameSettings GameSettings = GameSettings{ DefaultOpponents, DefaultTableState, DefaultGunState, DefaultGameAccepted, DefaultSpinChamberRule, DefaultSpinChamberOnShotRule, DefaultReplaceBulletRule, DefaultChannel, }
type GunState ¶
type GunState struct { Chambers []bool `json:"chambers"` NumChamber int `json:"num_chambers"` NumBullets int `json:"num_bullets"` NumBulletsLeft int `json:"num_bullets_left"` CurrentChamber int `json:"current_chamber"` }
var DefaultGunState GunState = GunState{ DefaultChamber, DefaultNumChamber, DefaultNumBullet, DefaultNumBulletsLeft, DefaultCurrentChamber, }
func (*GunState) CountBullets ¶
func (*GunState) SetNextChamber ¶
func (g *GunState) SetNextChamber()
func (*GunState) SpinChamber ¶
func (g *GunState) SpinChamber()
type Handler ¶
type Handler struct { CommandSpecs *discordgo.ApplicationCommand CommandHandler func(s *discordgo.Session, i *discordgo.InteractionCreate) }
type Item ¶
type Item struct { Name string Description string Inventory int Effect func(*GameSettings) }
func (*Item) Use ¶
func (i *Item) Use(s *GameSettings) string
type TableState ¶
type TableState struct { Losers []string `json:"losers"` Turns []string `json:"turns"` CurrentTurn int `json:"current_turn"` }
var DefaultTableState TableState = TableState{ DefaultLosers, DefaultTurns, DefaultCurrentTurn, }
func (*TableState) GetCurrentPlayer ¶
func (t *TableState) GetCurrentPlayer() string
func (*TableState) Ongoing ¶
func (t *TableState) Ongoing() bool
func (*TableState) RemovePlayer ¶
func (t *TableState) RemovePlayer(user string) error
func (*TableState) SetNextPlayer ¶
func (t *TableState) SetNextPlayer()
func (*TableState) SpinTable ¶
func (t *TableState) SpinTable()
Click to show internal directories.
Click to hide internal directories.