Documentation
¶
Overview ¶
Package instance defines those parts of the emulation that might change from instance to instance of the VCS type, but is not actually the VCS itself.
Particularly useful when running more than one instance of the emulation in parallel.
Package instance defines those parts of the emulation that might change from instance to instance of the VCS type, but is not actually the VCS itself.
Particularly useful when running more than one instance of the emulation in parallel.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
Label Label
Random *random.Random
// the prefrences of the running instance. this instance can be shared
// with other running instances of the emulation.
Prefs *preferences.Preferences
// for performance purposes revision preferences are treated slightly
// different to other preference values. rather than accessing the fields
// in Prefs.Revision directly, the TIA emulation should read the fields in
// the LiveRevisionPreferences type. these values are updated with the
// UpdateRevision() function.
Revision preferences.LiveRevisionPreferences
}
Instance defines those parts of the emulation that might change between different instantiations of the VCS type, but is not actually the VCS itself.
func NewInstance ¶
func NewInstance(tv random.TV, prefs *preferences.Preferences) (*Instance, error)
NewInstance is the preferred method of initialisation for the Instance type.
The two arguments must be supplied. In the case of the prefs field it can by nil and a new prefs instance will be created. Providing a non-nil value allows the preferences of more than one VCS instance to be synchronised.
func (*Instance) Normalise ¶
func (ins *Instance) Normalise()
Normalise ensures the VCS instance is in an known default state. Useful for regression testing where the initial state must be the same for every run of the test.
func (*Instance) UpdateRevision ¶
func (ins *Instance) UpdateRevision()
UpdateRevision updates the live revision preference values for the running emulation.