parser

package
v2.0.0-...-dfa404a Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Components = make(map[string]any)
	Systems    = make(map[string]any)
)

Functions

This section is empty.

Types

type Component

type Component struct {
	Name  string
	Value any
}

func (*Component) MarshalJSON

func (c *Component) MarshalJSON() ([]byte, error)

func (*Component) UnmarshalJSON

func (c *Component) UnmarshalJSON(raw []byte) error

type Entity

type Entity struct {
	Components []*Component `json:"components"`
}

type ErrUnregisteredComponent

type ErrUnregisteredComponent struct{ Name string }

func (ErrUnregisteredComponent) Error

func (err ErrUnregisteredComponent) Error() string

type ErrUnregisteredSystem

type ErrUnregisteredSystem struct{ Name string }

func (ErrUnregisteredSystem) Error

func (err ErrUnregisteredSystem) Error() string

type Game

type Game struct {
	Title   string `json:"title"`
	Version string `json:"version"`

	// World is the name of the world to start on.
	World string `json:"world"`

	// Scene is the name of the scene to start on.
	Scene string `json:"scene"`

	Debug bool `json:"debug"`
	Trace bool `json:"trace"`

	Worlds []*World `json:"worlds"`
}

type Scene

type Scene struct {
	Name     string    `json:"name"`
	Entities []*Entity `json:"entities"`
}

func (*Scene) UnmarshalJSON

func (s *Scene) UnmarshalJSON(raw []byte) error

type SceneLoader

type SceneLoader struct{}

type System

type System struct {
	Name  string
	Value any
}

func (*System) MarshalJSON

func (s *System) MarshalJSON() ([]byte, error)

func (*System) UnmarshalJSON

func (s *System) UnmarshalJSON(raw []byte) error

type World

type World struct {
	Name    string    `json:"name"`
	Assets  string    `json:"assets"`
	Systems []*System `json:"systems"`
	Scenes  []*Scene  `json:"scenes"`
}

func (*World) UnmarshalJSON

func (w *World) UnmarshalJSON(raw []byte) error

Jump to

Keyboard shortcuts

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