Versions in this module Expand all Collapse all v0 v0.1.0 Jun 14, 2026 Changes in this version + const UVCurrentSpeed + const UVFinishedDying + const UVWeaponAimAborted + const UVWeaponLaunchNow + const UVWeaponReady + type Host interface + EmitSfx func(sfxType, piece int) + Explode func(piece, sfxType int) + GetUnitValue func(port int) int32 + PlaySound func(sound, volume int) + SetUnitValue func(port, value int) + type Instruction struct + Offset uint32 + Op uint32 + P1 int32 + P2 int32 + type Program struct + func FromCOB(c *scripting.COB) (*Program, error) + func NewProgram(pieceNames []string, numStatic int, scripts []ScriptSource) *Program + func (p *Program) HasScript(name string) bool + func (p *Program) PieceNames() []string + func (p *Program) ScriptIndex(name string) (int, bool) + func (p *Program) ScriptNames() []string + func (p *Program) SoundName(i int) string + type Runtime struct + func NewRuntime(seed uint32) *Runtime + func (r *Runtime) KillAllThreads() + func (r *Runtime) NewUnit(p *Program, host Host) *Unit + func (r *Runtime) Reset() + func (r *Runtime) RestoreRng(state uint32) + func (r *Runtime) SnapshotRng() uint32 + func (r *Runtime) Tick(ms int64) + type ScriptSource struct + Insts []Instruction + Name string + type Unit struct + func (u *Unit) AddBreakpoint(scriptIdx int, offset uint32) + func (u *Unit) AimStatus(id int32) (done bool, ret int32) + func (u *Unit) ClearBreakpointHits() + func (u *Unit) ClearBreakpoints() + func (u *Unit) CobState() frame.CobUnitState + func (u *Unit) Coverage() map[int][]uint32 + func (u *Unit) DrainEffects() []frame.Event + func (u *Unit) ExportCob() frame.CobSnapshot + func (u *Unit) FinishedDying() bool + func (u *Unit) HasScript(name string) bool + func (u *Unit) ImportCob(snap frame.CobSnapshot) + func (u *Unit) KillAllThreads() + func (u *Unit) KillThread(id int32) + func (u *Unit) KillThreadsByName(name string) + func (u *Unit) KilledStatus(id int32) (done bool, corpsetype int32) + func (u *Unit) Pieces() []frame.PieceState + func (u *Unit) RemoveBreakpoint(scriptIdx int, offset uint32) + func (u *Unit) ResetState() + func (u *Unit) Restart(name string, args ...int) + func (u *Unit) RunQuery(name string, args ...int) (int32, bool) + func (u *Unit) ScriptNames() []string + func (u *Unit) SetStatic(idx int, v int32) + func (u *Unit) SetThreadLocal(id int32, idx int, v int32) + func (u *Unit) SetThreadPC(id int32, pc int) + func (u *Unit) SetUnitValuePort(port int, v int32) + func (u *Unit) Start(name string, args ...int) + func (u *Unit) StartAim(name string, args ...int) int32 + func (u *Unit) StepThread(id int32) + func (u *Unit) TakeWeaponAimAborted(slot int) bool + func (u *Unit) TakeWeaponReady(slot int) bool + func (u *Unit) UnitValuePort(port int) int32