wfc

package
v0.0.0-...-848cd82 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reverse

func Reverse(s string) string

Types

type Config

type Config struct {
	MapWidth   int     `json:"mapWidth"`
	MapHeight  int     `json:"mapHeight"`
	TileWidth  float64 `json:"tileWidth"`
	TileHeight float64 `json:"tileHeight"`
	TileMap    struct {
		Path  string `json:"path"`
		Tiles []struct {
			Key      string  `json:"key"`
			Top      float64 `json:"top"`
			Left     float64 `json:"left"`
			Width    float64 `json:"width"`
			Height   float64 `json:"height"`
			Priority int     `json:"priority"`
		} `json:"tiles,omitempty"`
	} `json:"tileMap,omitempty"`
	Tile []struct {
		Path string `json:"path"`
		Key  string `json:"key"`
	} `json:"tile,omitempty"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig : Loads the configuration file

func (*Config) Validate

func (c *Config) Validate() error

type Surface

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

type Wfc

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

func NewWFC

func NewWFC(da *gtk.DrawingArea, configPath string) (*Wfc, error)

func (*Wfc) Generate

func (w *Wfc) Generate()

Generate generates a new "world"

Jump to

Keyboard shortcuts

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