ops

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: MIT, Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCommand

func DecodeCommand(d []byte) scene.Command

func DecodeLoad

func DecodeLoad(data []byte) (int, opconst.StateMask)

DecodeLoad decodes the state id and mask of a load op.

func DecodeSave

func DecodeSave(data []byte) int

DecodeSave decodes the state id of a save op.

func DecodeTransform

func DecodeTransform(data []byte) (t f32.Affine2D)

func EncodeCommand

func EncodeCommand(out []byte, cmd scene.Command)

Types

type EncodedOp

type EncodedOp struct {
	Key  Key
	Data []byte
	Refs []interface{}
}

EncodedOp represents an encoded op returned by Reader.

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key is a unique key for a given op.

func (Key) SetTransform

func (k Key) SetTransform(t f32.Affine2D) Key

type PC

type PC struct {
	// contains filtered or unexported fields
}

PC is an instruction counter for an operation list.

func NewPC

func NewPC(ops *op.Ops) PC

NewPC returns a PC representing the current instruction counter of ops.

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader parses an ops list.

func (*Reader) Decode

func (r *Reader) Decode() (EncodedOp, bool)

func (*Reader) Reset

func (r *Reader) Reset(ops *op.Ops)

Reset start reading from the beginning of ops.

func (*Reader) ResetAt

func (r *Reader) ResetAt(ops *op.Ops, pc PC)

ResetAt is like Reset, except it starts reading from pc.

Jump to

Keyboard shortcuts

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