helper

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPlayerDataToSheet added in v0.3.0

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

func AddPoolDataToSheet added in v0.3.0

func AddPoolDataToSheet(f *excelize.File, pools []Pool, sanatize 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 CalculateDepthForLeafs

func CalculateDepthForLeafs(leafs int) int

Function to calculate the depth of a balanced tree for a given number of leaf nodes

func CalculateNodesForLeafs

func CalculateNodesForLeafs(leafs int) int

func ConvertPlayersToWinners added in v0.3.0

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

func CreateNamesToPrint

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

func CreateNamesWithPoolToPrint added in v0.3.0

func CreateNamesWithPoolToPrint(f *excelize.File, pools []Pool, sanatized 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, writeValue bool, value string) string

func FillInMatches

func FillInMatches(f *excelize.File, matches []string) map[string]int

func FindMaxDepth

func FindMaxDepth(node *Node) int

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 InOrderTraversal

func InOrderTraversal(root *Node) []string

func MatchHeader

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

func OrderStringsAlphabetically

func OrderStringsAlphabetically(strings []string) []string

func PrintEliminationMatches

func PrintEliminationMatches(f *excelize.File, poolMatchWinners map[string]MatchWinner, matchMapping map[string]int, eliminationMatchRounds [][]EliminationMatch)

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, matchMapping map[string]int, eliminationMatchRounds [][]EliminationMatch, numTeamMatches int)

func RemoveDuplicates

func RemoveDuplicates(input []string) []string

func Walk

func Walk(t *Node, ch chan int)

Types

type EliminationMatch

type EliminationMatch struct {
	// Match Number
	Number int

	// Pool Number winner or Cell value
	Left string

	// Pool Number winner or Cell value
	Right string
}

func TraverseRounds

func TraverseRounds(node *Node, depth int, maxDepth int, matchMapping map[string]int) []EliminationMatch

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

	// Pool Number or Cell value
	LeafVal string
	Val     int
	Left    *Node
	Right   *Node
}

func CreateBalancedTree

func CreateBalancedTree(leafValues []string, sanatize bool) *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