challenge

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RandomEmoji       = "🎲"
	RandomString      = "Random"
	RandomFancyString = RandomEmoji + " " + EmojiDelimiter + RandomString
)
View Source
var EmojiDelimiter = string([]byte{0x1f})

Functions

This section is empty.

Types

type Completion

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

func NewCompletion

func NewCompletion(userID string, duration time.Duration) Completion

func (Completion) Duration

func (c Completion) Duration() time.Duration

func (Completion) UserID

func (c Completion) UserID() string

type Config

type Config struct {
	Game game.Model

	Location *location.Model
	Distance *stage.Distance
	Stage    *stage.Model
	Weather  *weather.Model

	Car        *car.Model
	Class      *class.Model
	Drivetrain *drivetrain.Model
}

func (Config) FancyCarString

func (c Config) FancyCarString() string

func (Config) FancyStageString

func (c Config) FancyStageString() string

func (Config) String

func (c Config) String() string

type Model

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

func NewChallenge

func NewChallenge(s stage.Model, w weather.Model, car car.Model, completions []Completion) Model

func NewRandomChallenge

func NewRandomChallenge(c Config, r Randomiser) Model

func (*Model) Car

func (m *Model) Car() car.Model

func (*Model) Completions

func (m *Model) Completions() []Completion

func (*Model) FancyListCompletions

func (m *Model) FancyListCompletions() map[string]string

func (*Model) FancyString

func (m *Model) FancyString() string

func (*Model) RegisterCompletion

func (m *Model) RegisterCompletion(c Completion)

func (*Model) Stage

func (m *Model) Stage() stage.Model

func (*Model) TopThree added in v0.2.0

func (m *Model) TopThree() []Completion

func (*Model) UserCompletions added in v0.2.1

func (m *Model) UserCompletions() map[string][]time.Duration

func (*Model) Weather

func (m *Model) Weather() weather.Model

type Randomiser

type Randomiser interface {
	Car() car.Model
	CarFromClass(class class.Model) car.Model
	CarFromDrivetrain(drivetrain drivetrain.Model) car.Model

	Loc() location.Model
	Weather(loc location.Model) weather.Model
	Stage(loc location.Model) stage.Model
}

Jump to

Keyboard shortcuts

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