racestints

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown = "unknown"
)

Variables

View Source
var ErrUnmarshalNil = errors.New("can't unmarshal a nil value")

Functions

func Calc added in v0.25.0

Types

type BaseCalcParams added in v0.25.0

type BaseCalcParams interface {
	SetRaceDur(time.Duration)
	SetLps(int)
	SetPitTime(time.Duration)
	SetAvgLap(time.Duration)
}

type CalcStints

type CalcStints interface {
	Calc() (*Result, error)
}

type CalcType added in v0.25.0

type CalcType int
const (
	CalcTypeSimple CalcType = iota
	CalcTypeExpert
)

func ParseCalcType added in v0.25.0

func ParseCalcType(text string) (CalcType, error)

func (CalcType) MarshalText added in v0.25.0

func (c CalcType) MarshalText() ([]byte, error)

func (CalcType) String added in v0.25.0

func (c CalcType) String() string

func (*CalcType) UnmarshalText added in v0.25.0

func (c *CalcType) UnmarshalText(text []byte) error

type Part

type Part interface {
	Type() PartType
	Output() string
}

type PartType

type PartType int
const (
	PartTypeStint PartType = iota
	PartTypePit
)

type PitPart

type PitPart interface {
	Part
	PitTime() time.Duration
}

type Result

type Result struct {
	Parts []Part
}

type StintPart

type StintPart interface {
	Part
	Laps() int
	LapStart() int
	LapEnd() int
	StintTime() time.Duration
}

Jump to

Keyboard shortcuts

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