ronnied

package
v0.0.0-...-10f3eee Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	ID        string     `json:"id"`   // Channel ID
	Name      string     `name:"name"` // channel name when created
	StartedAt *time.Time `json:"started_at"`
	Players   []string   `json:"players"`
}

func UnmarshalGameString

func UnmarshalGameString(input string) (*Game, error)

func (*Game) HasPlayer

func (g *Game) HasPlayer(playerID string) bool

func (*Game) MarshalGameString

func (g *Game) MarshalGameString() string

func (*Game) String

func (g *Game) String() string

type GameEntry

type GameEntry struct {
	ID             string     `json:"id"`
	GameID         string     `json:"game_id"`
	PlayerID       string     `json:"player_id"`
	Roll           int        `json:"roll"`
	AssignedTo     string     `json:"assigned_to"`
	Status         string     `json:"status"` // TODO: what statuses can we have?
	CreatedDate    *time.Time `json:"created_date"`
	ReconciledDate *time.Time `json:"reconciled_date"`
}

type GameTab

type GameTab struct {
	GameID      string `json:"game_id"`
	PlayerID    string `json:"player_id"`
	GameEntryID string `json:"game_entry_id"`
}

type Player

type Player struct {
	ID   string
	Name string
}

type RollType

type RollType string
const (
	RollTypeStart   RollType = "start"
	RollTypeRollOff RollType = "roll_off"
)

type Session

type Session struct {
	ID          string
	MessageID   string // TODO: move to SessionRoll
	SessionDate *time.Time
	GameID      string
	Players     []*Player
	StartedDate *time.Time
}

func (*Session) HasPlayer

func (s *Session) HasPlayer(playerID string) *Player

type SessionEntry

type SessionEntry struct {
	ID            string
	SessionRollID string
	PlayerID      string
	Roll          int
	AssignedTo    string
	Completed     bool
}

func (*SessionEntry) Complete

func (se *SessionEntry) Complete()

func (*SessionEntry) IsComplete

func (se *SessionEntry) IsComplete() bool

func (*SessionEntry) String

func (se *SessionEntry) String() string

type SessionRoll

type SessionRoll struct {
	ID        string
	SessionID string
	Type      RollType
	Players   []*Player // players involved in this roll
	Entries   []*SessionEntry
}

func (*SessionRoll) HasPlayer

func (sr *SessionRoll) HasPlayer(playerID string) *Player

func (*SessionRoll) HasPlayerEntry

func (sr *SessionRoll) HasPlayerEntry(playerID string) *SessionEntry

func (*SessionRoll) IsComplete

func (sr *SessionRoll) IsComplete() bool

func (*SessionRoll) IsLoser

func (sr *SessionRoll) IsLoser(input *SessionEntry) bool

LoserEntires the entries that have the lowest score

type Tab

type Tab struct {
	PlayerID string `json:"player_id"`
	Count    int    `json:"count"`
}

Jump to

Keyboard shortcuts

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