highscores

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package highscores implements the Termacade high scores viewer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchRecording

func FetchRecording(ctx context.Context, code string) (*arcade.Recording, error)

FetchRecording downloads a high scores recording.

Types

type Entry

type Entry struct {
	Code   string `json:"c"`
	Score  int64  `json:"s"`
	Player string `json:"p"`
}

Entry is a single item in the high scores list.

func FetchScores

func FetchScores(ctx context.Context, game arcade.Game, mode Mode, page int) ([]Entry, error)

FetchScores downloads a page of high scores data from the server.

type HighScores

type HighScores struct {
	Camera gfx.Camera
	CRT    crt.CRT

	Game  arcade.Game
	Mode  Mode
	Page  int
	Index int
	// contains filtered or unexported fields
}

HighScores is the high scores viewer.

func (*HighScores) Run

func (hs *HighScores) Run(ctx context.Context) error

Run displays the high scores viewer.

type Mode

type Mode uint8

Mode is a high scores filtering mode.

const (
	Recent    Mode = 'r'
	Weekly    Mode = 'w'
	Quarterly Mode = 'q'
	AllTime   Mode = 'a'
)

Constants for Mode.

func (Mode) String

func (i Mode) String() string

type RecordingViewer

type RecordingViewer struct {
	Code string
}

RecordingViewer displays a game recording.

func (*RecordingViewer) Run

func (v *RecordingViewer) Run(ctx context.Context) error

Run plays the recording.

Jump to

Keyboard shortcuts

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