cli

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ObjectMessage = ObjectType("message")
	ObjectDisplay = ObjectType("display")
	ObjectMemory  = ObjectType("memory")
)

Variables

This section is empty.

Functions

func ConstructObjectsFromConfig

func ConstructObjectsFromConfig() (map[string]interface{}, error)

func DrawRegularPolygon

func DrawRegularPolygon(ctx *gg.Context, n int, x, y, r, rotation float64)

Types

type Config

type Config struct {
	Objects []ObjectConfig
}

type Display

type Display struct {
	Width            int
	Height           int
	Scale            float64
	Output           string
	FrameCount       int
	PreviousFrame    image.Image
	SaveCurrentFrame func(img image.Image, display *Display)
}

func NewDisplay

func NewDisplay(config ObjectConfig) (*Display, error)

func (*Display) DrawFlush

func (m *Display) DrawFlush(buffer []runtime.DrawStatement)

type DisplayOptions

type DisplayOptions struct {
	Width  int
	Height int
	Scale  float64
	Output string
}

type Memory

type Memory struct {
	Name string
	Size int64
	Data map[int64]float64
}

func NewMemory

func NewMemory(config ObjectConfig) (*Memory, error)

func (*Memory) Read

func (m *Memory) Read(position int64) float64

func (*Memory) Write

func (m *Memory) Write(value float64, position int64)

type MemoryOptions

type MemoryOptions struct {
	Size int64
}

type Message

type Message struct {
	Name   string
	Output io.Writer
}

func NewMessage

func NewMessage(config ObjectConfig) (*Message, error)

func (Message) PrintFlush

func (m Message) PrintFlush(buffer string)

type MessageHijacker

type MessageHijacker struct {
	Prefix string
	Output io.Writer
}

func (MessageHijacker) Write

func (h MessageHijacker) Write(p []byte) (n int, err error)

type MessageOptions

type MessageOptions struct {
	Output string
}

type ObjectConfig

type ObjectConfig struct {
	Type    ObjectType
	Name    string
	Options json.RawMessage
}

type ObjectType

type ObjectType string

Jump to

Keyboard shortcuts

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