Documentation ¶
Overview ¶
Package environment provides context for an emulation.
Index ¶
Constants ¶
const MainEmulation = Label("main")
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 // interface to emulation. used for example, when cartridge has been // successfully loaded. not all cartridge formats require this Notifications notifications.Notify // the emulation preferences Prefs *preferences.Preferences // any randomisation required by the emulation should be retreived through // this structure Random *random.Random }
Environment is used to provide context for an emulation. Particularly useful when using multiple emulations
func NewEnvironment ¶
func NewEnvironment(tv Television, notify notifications.Notify, prefs *preferences.Preferences) (*Environment, error)
NewEnvironment is the preferred method of initialisation for the Environment type.
The Notify and Preferences can be nil. If prefs is nil then a new instance of the system wide preferences will be created.
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 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