environment

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package environment provides context for an emulation.

Index

Constants

View Source
const MainEmulation = Label("")

MainEmulation is the label used for the main emulation

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	// label distinguishes between different types of emulation (thumbnailer, etc.)
	Label Label

	// the television attached to the console
	TV Television

	// any randomisation required by the emulation should be retreived through
	// this structure
	Random *random.Random

	// the emulation preferences
	Prefs *preferences.Preferences
}

Environment is used to provide context for an emulation. Particularly useful when using multiple emulations

func NewEnvironment

func NewEnvironment(tv *television.Television, prefs *preferences.Preferences) (*Environment, error)

NewEnvironment is the preferred method of initialisation for the Environment type.

The two arguments must be supplied. In the case of the prefs field it can by nil and a new Preferences instance will be created. Providing a non-nil value allows the preferences of more than one VCS emulation to be synchronised.

func (*Environment) IsEmulation

func (env *Environment) IsEmulation(label Label) bool

IsEmulation checks the emulation label and returns true if it matches

func (*Environment) Normalise

func (env *Environment) Normalise()

Normalise ensures the environment is in an known default state. Useful for regression testing where the initial state must be the same for every run of the test.

type Label

type Label string

Label is used to name the environment

type Television added in v0.26.0

type Television interface {
	GetSpecID() string
	SetRotation(specification.Rotation)
}

Television interface exposing a minimum amount of the real television implementation

Jump to

Keyboard shortcuts

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