karting

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitialELO = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct {
	Name      string
	ELO       int
	ELOChange int
	Stats     *DriverStats
}

type DriverStats

type DriverStats struct {
	TotalRaces           int
	TotalWins            int
	AllTimeAverageFinish float64
	Last5Finish          []int
	PeakELO              int
}

type Event

type Event struct {
	Results []*Result
	Date    int64
}

type Karting

type Karting struct {
	Drivers []*Driver
	Races   []Event
}

func NewKarting

func NewKarting() *Karting

func (*Karting) Graph

func (k *Karting) Graph()

func (*Karting) Race

func (k *Karting) Race(results []*Result) ([]RaceDiff, error)

func (*Karting) Register

func (k *Karting) Register(name string) (string, error)

func (*Karting) Reset

func (k *Karting) Reset()

func (*Karting) Unregister

func (k *Karting) Unregister(name string) (string, error)

type RaceDiff

type RaceDiff struct {
	Driver *Driver
	Change int
}

type Result

type Result struct {
	Position int
	Driver   *Driver
}

Jump to

Keyboard shortcuts

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