cache

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomJSONDir string

CustomJSONDir is the location where custom JSON files generated by the user are saved.

Functions

This section is empty.

Types

type ArtCache

type ArtCache struct {
	Art map[string]ArtMetadata `json:"art"`

	Version string `json:"version"`
	// contains filtered or unexported fields
}

ArtCache is a struct containing all pixel art metadata and a version string.

func New

func New(version string) *ArtCache

New will return a new ArtCache struct pointer with the specified version.

func (*ArtCache) GetFileOf

func (c *ArtCache) GetFileOf(name string) string

GetFileOf will return the cached filename for the specified art.

func (*ArtCache) GetHeightOf

func (c *ArtCache) GetHeightOf(name string) int

GetHeightOf will return the cached height for the specified art.

func (*ArtCache) GetWidthOf

func (c *ArtCache) GetWidthOf(name string) int

GetWidthOf will return the cached width for the specified art.

func (*ArtCache) List

func (c *ArtCache) List() []string

List will return a list of names for any cached art files.

func (*ArtCache) Refresh

func (c *ArtCache) Refresh() error

Refresh will read any found JSON files and update the art cache.

func (*ArtCache) Save added in v1.5.0

func (c *ArtCache) Save() error

Save will write the ArtCache to disk.

func (*ArtCache) String added in v1.5.0

func (c *ArtCache) String() string

String will return a string representation of the ArtCache.

func (*ArtCache) Update

func (c *ArtCache) Update() error

Update will download the newest art files from github.com and refresh the local cache.

type ArtMetadata added in v1.5.0

type ArtMetadata struct {
	File   string `json:"file"`
	Height int    `json:"height"`
	Width  int    `json:"width"`
}

ArtMetadata is a struct containing relevant metadata about supported pixel art.

Jump to

Keyboard shortcuts

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