score

package
v0.0.0-...-efee7b9 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultScorer

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

func (*DefaultScorer) ApplyHistoryToChart

func (s *DefaultScorer) ApplyHistoryToChart(ch *game.Chart, history *History) *game.Chart

func (*DefaultScorer) ApplyInputToChart

func (s *DefaultScorer) ApplyInputToChart(chart *game.Chart, input *game.Input, rate uint16) (note *game.Note, distance, absDistance time.Duration)

func (*DefaultScorer) Deinit

func (s *DefaultScorer) Deinit()

func (*DefaultScorer) Distance

func (s *DefaultScorer) Distance(rate uint16, expected, actual time.Duration) time.Duration

func (*DefaultScorer) DistanceFloat

func (s *DefaultScorer) DistanceFloat(rate uint16, expected, actual time.Duration) time.Duration

func (*DefaultScorer) GetClosestNote

func (s *DefaultScorer) GetClosestNote(chart *game.Chart, input *game.Input, rate uint16) (note *game.Note, distance, abs time.Duration)

Binary search for closest note, game.Chart should be in order

func (*DefaultScorer) Init

func (s *DefaultScorer) Init() error

func (*DefaultScorer) Load

func (s *DefaultScorer) Load(c *game.Chart) []History

func (*DefaultScorer) Save

func (s *DefaultScorer) Save(c *game.Chart, inputs *[]game.Input, rate uint16)

func (*DefaultScorer) Score

func (s *DefaultScorer) Score(chart *game.Chart, history *History) Score

type History

type History struct {
	Sum    string
	Inputs *[]game.Input
	Rate   uint16
}

type InputsCompact

type InputsCompact struct {
	Index uint8
	Times []time.Duration
}

type Score

type Score struct {
	MissCount  uint64
	TotalError time.Duration
}

type Scorer

type Scorer interface {
	Init() error
	Deinit()

	// Save the state of this performance
	Save(chart *game.Chart, inputs *[]game.Input, rate uint16)

	// Load up previous state for the chart
	Load(chart *game.Chart) []History

	Score(chart *game.Chart, history *History) Score
	ApplyInputToChart(chart *game.Chart, input *game.Input, rate uint16) (note *game.Note, distance, absDistance time.Duration)

	Distance(rate uint16, expected, actual time.Duration) time.Duration
}

Jump to

Keyboard shortcuts

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