highscores

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 18 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 arcade.HighScoresMode, 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  arcade.HighScoresMode
	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) (*router.PageInfo, error)

Run displays the high scores viewer.

type RecordingViewer

type RecordingViewer struct {
	Code string
	// contains filtered or unexported fields
}

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