skating

package
Version: v0.0.0-...-99b79bc Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRILIMINARY_ROUND = "preliminary"
	FINAL_ROUND       = "final"
)
View Source
const (
	ALGORITHM_SKATING = "skating"
)

Variables

View Source
var DUPLICATE_PLACEMENT_ERROR = func(placement int) error {
	return errors.New(fmt.Sprintf("placement %v is already taken by someone else", placement))
}
View Source
var INVALID_PLACEMENT_ERROR = func(coupleID, placement int) error {
	return errors.New(fmt.Sprintf("couple %v of has invalid placement: %v", coupleID, placement))
}
View Source
var PLACEMENT_OUTOFRANGE_ERROR = func(coupleID, placement int) error {
	return errors.New(fmt.Sprintf("placement of couple %v is out of range: %v", coupleID, placement))
}

Functions

This section is empty.

Types

type DanceScoreSheet

type DanceScoreSheet struct {
}

func NewDanceScoreSheet

func NewDanceScoreSheet() DanceScoreSheet

func (*DanceScoreSheet) AddJudgeMarks

func (sheet *DanceScoreSheet) AddJudgeMarks(marks JudgeMarks)

func (DanceScoreSheet) CalculateDancePlacements

func (sheet DanceScoreSheet) CalculateDancePlacements(algorithm, roundType string) ([][]int, error)

type JudgeMarks

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

func NewJudgeMarks

func NewJudgeMarks(roundSize int) JudgeMarks

func (*JudgeMarks) AddCallback

func (marks *JudgeMarks) AddCallback(coupleID int, callback bool)

func (*JudgeMarks) AddPlacement

func (marks *JudgeMarks) AddPlacement(coupleID, placement int) error

AddPlacement adds judge's placement of couple to the marks. This function ensures that all couples receives a valid placement.

This method ensures compliance with Rule 4.

func (JudgeMarks) GetCallbacks

func (marks JudgeMarks) GetCallbacks() []int

GetCallbacks retrieves all the couples that are called back by the adjudicator.

This method ensures compliance with Rule 1.

func (JudgeMarks) GetCouples

func (marks JudgeMarks) GetCouples() []int

func (JudgeMarks) GetPlacements

func (marks JudgeMarks) GetPlacements() [][]int

type RoundScoreSheet

type RoundScoreSheet struct {
}

func NewRoundScoreSheet

func NewRoundScoreSheet() RoundScoreSheet

func (*RoundScoreSheet) AddDanceSheet

func (sheet *RoundScoreSheet) AddDanceSheet(danceSheet DanceScoreSheet)

func (RoundScoreSheet) CalculateRoundPlacements

func (sheet RoundScoreSheet) CalculateRoundPlacements(algorithm string) ([][]int, error)

Jump to

Keyboard shortcuts

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