helper

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFile embed.FS
View Source
var WebFs embed.FS

Functions

func AddPlayerDataToSheet added in v0.3.0

func AddPlayerDataToSheet(f *excelize.File, players []Player, sanitize bool)

func AddPoolDataToSheet added in v0.3.0

func AddPoolDataToSheet(f *excelize.File, pools []Pool, sanitize bool)

func AddPoolsToSheet

func AddPoolsToSheet(f *excelize.File, pools []Pool) error

func AddPoolsToTree

func AddPoolsToTree(f *excelize.File, sheetName string, pools []Pool)

func CalculateDepth

func CalculateDepth(node *Node) int

func ConvertPlayersToWinners added in v0.3.0

func ConvertPlayersToWinners(players []Player, sanitized bool) map[string]MatchWinner

func CreateNamesToPrint

func CreateNamesToPrint(f *excelize.File, players []Player, sanitized bool)

func CreateNamesWithPoolToPrint added in v0.3.0

func CreateNamesWithPoolToPrint(f *excelize.File, pools []Pool, sanitized bool)

func CreatePoolMatches

func CreatePoolMatches(pools []Pool)

func CreatePoolRoundRobinMatches

func CreatePoolRoundRobinMatches(pools []Pool)

func CreateTreeBracket

func CreateTreeBracket(f *excelize.File, sheet string, col int, startRow int, size int) string

func FillEstimations added in v0.6.0

func FillEstimations(f *excelize.File, numPools int, numPoolMatches int, extraPools int, teamSize int, numEliminationMatches int)

func FillInMatches

func FillInMatches(f *excelize.File, eliminationMatchRounds [][]*Node)

func GenerateFinals

func GenerateFinals(pools []Pool, poolWinners int) []string

func GetBorderStyleBottomLeft

func GetBorderStyleBottomLeft(f *excelize.File) int

func GetBorderStyleLeft

func GetBorderStyleLeft(f *excelize.File) int

func MatchHeader

func MatchHeader(f *excelize.File, sheetName string, startColName string, poolRow int, middleColName string, endColName string)

func PrintLeafNodes

func PrintLeafNodes(node *Node, f *excelize.File, sheetName string, startCol int, startRow int, depth int, pools bool)

func PrintPoolMatches

func PrintPoolMatches(f *excelize.File, pools []Pool, teamMatches int, numWinners int) map[string]MatchWinner

func PrintTeamEliminationMatches added in v0.2.0

func PrintTeamEliminationMatches(f *excelize.File, poolMatchWinners map[string]MatchWinner, eliminationMatchRounds [][]*Node, numTeamMatches int)

func ReadEntriesFromFile added in v0.9.0

func ReadEntriesFromFile(filePath string) ([]string, error)

func RemoveDuplicates

func RemoveDuplicates(input []string) []string

RemoveDuplicates removes duplicate strings from the input slice and returns a new slice without duplicates.

The function takes a parameter named input, which is a slice of strings. It represents the input slice from which duplicates and empty strings will be removed.

func RoundToPowerOf2 added in v0.4.0

func RoundToPowerOf2(x, y float64) int

Types

type Match

type Match struct {
	SideA *Player
	SideB *Player
}

type MatchWinner

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

type Node

type Node struct {
	LeafNode bool

	// sheet for Cell Values
	SheetName string

	// Pool Number or Cell value
	LeafVal string
	Val     int
	Left    *Node
	Right   *Node
	// contains filtered or unexported fields
}

func CreateBalancedTree

func CreateBalancedTree(leafValues []string, sanitize bool) *Node

func OrderStringsAlphabetically

func OrderStringsAlphabetically(strings []*Node) []*Node

func SubdivideTree added in v0.4.0

func SubdivideTree(node *Node, numSubtrees int) []*Node

function that subdivides a tree into a specified number of subtrees

func TraverseRounds

func TraverseRounds(node *Node, depth int, maxDepth int) []*Node

type Player

type Player struct {
	Name        string
	DisplayName string
	Dojo        string

	PoolPosition int
	// contains filtered or unexported fields
}

func CreatePlayers

func CreatePlayers(entries []string) []Player

type Pool

type Pool struct {
	PoolName string
	Players  []Player
	Matches  []Match
	// contains filtered or unexported fields
}

func CreatePools

func CreatePools(players []Player, poolSize int) []Pool

type RowStack added in v0.2.0

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

func (*RowStack) Peek added in v0.2.1

func (s *RowStack) Peek() int

func (*RowStack) Pop added in v0.2.0

func (s *RowStack) Pop() int

func (*RowStack) Push added in v0.2.0

func (s *RowStack) Push(value int)

func (*RowStack) PushHighest added in v0.2.1

func (s *RowStack) PushHighest(first int, second int)

type Stack

type Stack []*Node

func (*Stack) IsEmpty

func (s *Stack) IsEmpty() bool

func (*Stack) Pop

func (s *Stack) Pop() *Node

func (*Stack) Push

func (s *Stack) Push(node *Node)

Jump to

Keyboard shortcuts

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