ko

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSupportedSizes

func GetSupportedSizes() []int

GetSupportedSizes returns the supported tournament sizes

func ValidateTeamCount

func ValidateTeamCount(count int) error

ValidateTeamCount checks if a team count is supported

Types

type Config

type Config struct {
	Teams []string
}

func (Config) DetailedString

func (c Config) DetailedString() string

func (Config) String

func (c Config) String() string

type Round

type Round struct {
	RoundNumber int             `json:"round_number"`
	Name        string          `json:"name"`
	Fixtures    []types.Fixture `json:"fixtures"`
}

Round represents a round in the knockout tournament

func (Round) String

func (r Round) String() string

type Structure

type Structure struct {
	NumTeams    int
	NumRounds   int
	BracketSize int
}

Structure holds the calculated tournament parameters

func (Structure) String

func (s Structure) String() string

type Summary

type Summary struct {
	TotalTeams     int    `json:"total_teams"`
	NumRounds      int    `json:"num_rounds"`
	TotalFixtures  int    `json:"total_fixtures"`
	TournamentType string `json:"tournament_type"`
}

Summary provides tournament statistics

type Tournament

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

Tournament represents a complete single elimination knockout tournament

func New

func New(teams []string) (*Tournament, error)

func (*Tournament) Generate

func (t *Tournament) Generate() error

Generate creates the complete knockout bracket with random seeding

func (*Tournament) GetBracket

func (t *Tournament) GetBracket() []Round

func (*Tournament) GetRound

func (t *Tournament) GetRound(roundNumber int) (*Round, error)

GetRound returns a specific round by number (1-indexed)

func (*Tournament) GetRoundByName

func (t *Tournament) GetRoundByName(name string) (*Round, error)

GetRoundByName returns a round by its name

func (*Tournament) GetSummary

func (t *Tournament) GetSummary() Summary

GetSummary returns tournament statistics

func (*Tournament) GetTeams

func (t *Tournament) GetTeams() []types.Team

GetTeams returns all teams in seeded order

func (*Tournament) String

func (t *Tournament) String() string

Jump to

Keyboard shortcuts

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