tournament

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CompassDivisionNames = []string{"East", "East-northeast", "Northeast", "North-northeast", "North", "North-northwest", "Northwest", "West-northwest", "West", "West-southwest", "Southwest", "South-southwest", "South", "South-southeast", "Southeast", "East-southeast"}

CompassDivisionNames will be used for the bracket names

Functions

func BasicTeamScoreLess

func BasicTeamScoreLess(teams []TeamScore) func(i, j int) bool

func FlipTies

func FlipTies(place int) int

func NewCompassDraw

func NewCompassDraw(baseTournament models.Tournament) models.Tournament

NewCompassDraw creates and returns a Compass Draw tournament, using the base tournamnet from a StorageEngine

func NewDoubleElimination

func NewDoubleElimination(baseTournament models.Tournament) models.Tournament

func NewGroupCompetition

func NewGroupCompetition(children []models.Tournament, baseTournament models.Tournament) models.Tournament

NewGroupCompetition creates and returns a Group Competition tournament wrapping the provided children tournaments, and uses the provided backing StorageEngine tournamnent

func NewRoundRobin

func NewRoundRobin(baseTournament models.Tournament) models.Tournament

NewRoundRobin creates an returns a new Round Robin Tournamnet that uses the provided base tournament StorageEngine

func NewSingleElimination

func NewSingleElimination(name string, teams []models.Team, seeded bool, gameSize uint32, advance uint32, scored bool, baseTournament models.Tournament) models.Tournament

NewSingleElimination creates a new Single Elimination Tournament

Types

type CompassDraw

type CompassDraw struct {
	models.Tournament
	// contains filtered or unexported fields
}

CompassDraw fulfills the Tournament interface. Provides the logic for running a Tournament of a Compass Draw type. Commonly used in Tennis

func (*CompassDraw) GetActiveStage

func (c *CompassDraw) GetActiveStage() models.Tournament

func (*CompassDraw) GetBracketOrder

func (c *CompassDraw) GetBracketOrder() []string

func (*CompassDraw) NextRound

func (c *CompassDraw) NextRound() (models.Round, error)

func (*CompassDraw) Start

func (c *CompassDraw) Start()

func (*CompassDraw) StartRound

func (c *CompassDraw) StartRound()

type DoubleElimination

type DoubleElimination struct {
	models.Tournament
	// contains filtered or unexported fields
}

DoubleElimination fulfills the Tournament interface. Provides the logic for running a Tournament of a Double Elimination type. Commonly used as a conclusion of a season or competition

func (*DoubleElimination) GetActiveStage

func (d *DoubleElimination) GetActiveStage() models.Tournament

func (*DoubleElimination) GetBracketOrder

func (d *DoubleElimination) GetBracketOrder() []string

func (*DoubleElimination) NextRound

func (c *DoubleElimination) NextRound() (models.Round, error)

func (*DoubleElimination) Start

func (d *DoubleElimination) Start()

func (*DoubleElimination) StartRound

func (c *DoubleElimination) StartRound()

type GroupCompetition

type GroupCompetition struct {
	models.Tournament
	// contains filtered or unexported fields
}

Group Competition fulfills the Tournament interface. Provides the logic for running something like different leagues or groups within a larger tournament or season

func (*GroupCompetition) GetActiveRound

func (g *GroupCompetition) GetActiveRound() models.Round

func (*GroupCompetition) GetAllRounds

func (g *GroupCompetition) GetAllRounds() []models.Round

func (*GroupCompetition) GetBracketOrder

func (g *GroupCompetition) GetBracketOrder() []string

func (*GroupCompetition) GetRounds

func (g *GroupCompetition) GetRounds() models.Round

func (*GroupCompetition) NextRound

func (g *GroupCompetition) NextRound() (models.Round, error)

func (*GroupCompetition) StartRound

func (g *GroupCompetition) StartRound()

type Pivot

type Pivot struct {
	Place int
	Span  int
}

type RoundRobin

type RoundRobin struct {
	models.Tournament
	// contains filtered or unexported fields
}

RoundRobin fulfills the Tournament interface, and provides the logic for tournaments where every team plays every other team

func (*RoundRobin) GetBracketOrder

func (c *RoundRobin) GetBracketOrder() []string

func (*RoundRobin) NextRound

func (c *RoundRobin) NextRound() (models.Round, error)

func (*RoundRobin) Start

func (c *RoundRobin) Start()

func (*RoundRobin) StartRound

func (c *RoundRobin) StartRound()

type SingleElimination

type SingleElimination struct {
	models.Tournament
}

SingleElimination fulfills the Tournament interface. Provides the logic for running a Tournament of a Single Elimination type. Commonly used as a conclusion of a season or competition

func (*SingleElimination) GetActiveStage

func (s *SingleElimination) GetActiveStage() models.Tournament

func (*SingleElimination) GetBracketOrder

func (s *SingleElimination) GetBracketOrder() []string

func (*SingleElimination) NextRound

func (s *SingleElimination) NextRound() (models.Round, error)

func (*SingleElimination) Start

func (s *SingleElimination) Start()

func (*SingleElimination) StartRound

func (s *SingleElimination) StartRound()

type TeamScore

type TeamScore struct {
	Team  models.Team
	Score int
}

Jump to

Keyboard shortcuts

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