model

package
v0.0.0-...-9803d8e Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package model of kickertool

Index

Constants

View Source
const (
	ModeSwissSystem       = "swiss"
	ModeRounds            = "rounds"
	ModeRoundRobin        = "round_robin"
	ModeMonsterDYP        = "monster_dyp"
	ModeDoubleElimination = "double_elimination"
	ModeElimination       = "elimination"
)

Modes

View Source
const (
	NameTypeSingle     = "single"
	NameTypeBYP        = "byp"
	NameTypeDYP        = "dyp"
	NameTypeMonsterDYP = "monster_dyp"
)

Name Types

Variables

This section is empty.

Functions

This section is empty.

Types

type Discipline

type Discipline struct {
	Model

	Sets []Set `json:"sets,omitempty"`
}

Discipline .

type KnockOff

type KnockOff struct {
	Model

	Levels     []Level `json:"levels"`
	LeftLevels []Level `json:"leftLevels"`
	Third      Level   `json:"third"`

	Options    Options `json:"options"`
	ThirdPlace bool    `json:"thirdPlace"`
	Double     bool    `json:"double"`
	Size       int     `json:"size"`
	Finished   bool    `json:"bool"`
}

KnockOff .

type Level

type Level struct {
	Model

	Name  string `json:"name"`
	Plays []Play `json:"plays"`
}

Level .

type Model

type Model struct {
	ID   string `json:"_id"`
	Type string `json:"type"`
}

Model an entity that contains ID and type

type Options

type Options struct {
	Model

	Name       string `json:"name"`
	NumPoints  int    `json:"numPoints"`
	NumSets    int    `json:"numSets"`
	TwoAhead   bool   `json:"twoAhead"`
	FastInput  bool   `json:"fastInput"`
	Draw       bool   `json:"draw"`
	PointsWin  int    `json:"pointsWin"`
	PointsDraw int    `json:"pointsDraw"`
}

Options .

type Play

type Play struct {
	Model

	Valid       bool `json:"valid"`
	Deactivated bool `json:"deactivated"`
	Skipped     bool `json:"skipped"`
	TimeStart   int  `json:"timeStart"`
	TimeEnd     int  `json:"timeEnd"`
	Winner      int  `json:"winner"`
	Team1Result int  `json:"team1Result"`
	Team2Result int  `json:"team2Result"`
	Team1       struct {
		ID   string `json:"_id"`
		Type string `json:"type"`
	}
	Team2 struct {
		ID   string `json:"_id"`
		Type string `json:"type"`
	}
	Disciplines []Discipline `json:"disciplines"`
}

Play .

type Player

type Player struct {
	Model

	Name             string `json:"_name"`
	Removed          bool   `json:"removed"`
	Deactivated      bool   `json:"deactivated"`
	MarkedForRemoval bool   `json:"markedForRemoval"`
}

Player .

type Round

type Round struct {
	Model

	Name  string `json:"name"`
	Plays []Play `json:"plays,omitempty"`
}

Round .

type Set

type Set struct {
	Model

	Team1 int `json:"team1"`
	Team2 int `json:"team2"`
}

Set .

type Sport

type Sport struct {
	Name string `json:"name"`
}

Sport .

type Team

type Team struct {
	Model

	Players []Player
}

Team .

type Tournament

type Tournament struct {
	Model

	Sport    Sport     `json:"sport"`
	Name     string    `json:"name"`
	Created  time.Time `json:"created"`
	Version  string    `json:"version"`
	Mode     string    `json:"mode"`
	NameType string    `json:"nameType"`
	Options  Options   `json:"options"`

	NumRounds int      `json:"numRounds"`
	Players   []Player `json:"players"`
	Teams     []Team   `json:"teams"`

	// for pre-eliminations
	Rounds []Round `json:"rounds"`

	// for eliminations
	KnockOffs []KnockOff `json:"ko"`
}

Tournament .

func (Tournament) EliminationMode

func (t Tournament) EliminationMode() string

EliminationMode .

func (Tournament) IsBYP

func (t Tournament) IsBYP() bool

IsBYP .

func (Tournament) IsDYP

func (t Tournament) IsDYP() bool

IsDYP .

func (Tournament) IsDouble

func (t Tournament) IsDouble() bool

IsDouble .

func (Tournament) IsMonsterDYP

func (t Tournament) IsMonsterDYP() bool

IsMonsterDYP .

func (Tournament) IsSingle

func (t Tournament) IsSingle() bool

IsSingle .

func (Tournament) PreliminaryMode

func (t Tournament) PreliminaryMode() string

PreliminaryMode .

func (Tournament) TournamentMode

func (t Tournament) TournamentMode() string

TournamentMode .

Jump to

Keyboard shortcuts

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