domain

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package domain defines the core domain models for the bracket creator

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignSeeds

func AssignSeeds(players []Player, assignments []SeedAssignment) error

AssignSeeds applies valid seed assignments to a list of players It swaps seeds if a collision occurs. Returns error if a seeded participant is not found.

func ValidateAssignments

func ValidateAssignments(assignments []SeedAssignment) error

ValidateAssignments checks a list for duplicate seed ranks and valid properties.

Types

type Match

type Match struct {
	ID     string
	SideA  *Player
	SideB  *Player
	Winner *Player
}

Match represents a match between two players

type MatchWinner

type MatchWinner struct {
	PlayerID string
	MatchID  string
}

MatchWinner represents a player who has won a match

type Player

type Player struct {
	ID           string
	Name         string
	DisplayName  string
	Dojo         string
	PoolPosition int64
	Seed         int
}

Player represents a tournament participant

func (*Player) Matches

func (p *Player) Matches(name string) bool

Matches checks if the player's name exactly matches the given name (case-sensitive)

type Pool

type Pool struct {
	ID      string
	Name    string
	Players []Player
	Matches []Match
}

Pool represents a group of players in the tournament

type SeedAssignment

type SeedAssignment struct {
	Name     string
	SeedRank int
}

SeedAssignment represents the mapping of a previous winner to a seed position.

func (*SeedAssignment) Validate

func (s *SeedAssignment) Validate() error

Validate checks if the seed assignment is valid.

type Tournament

type Tournament struct {
	Name               string
	Pools              []Pool
	EliminationMatches []Match
}

Tournament represents the complete tournament structure

Jump to

Keyboard shortcuts

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