unit

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Units map[string]*Unit
)

Functions

func TypeStrings

func TypeStrings() []string

TypeStrings returns a slice of all String values of the enum

Types

type Type

type Type int
const (
	Spirit Type = iota
	Spirit2
	Flam
	Flam2
	Octopus
	Octopus2
	Raccon
	GoldRacoon
	Cyclope
	Cyclope2
)

func TypeString

func TypeString(s string) (Type, error)

TypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func TypeValues

func TypeValues() []Type

TypeValues returns all values of the enum

func (Type) IsAType

func (i Type) IsAType() bool

IsAType returns "true" if the value is listed in the enum definition. "false" otherwise

func (Type) String

func (i Type) String() string

type Unit

type Unit struct {
	Type Type

	Health float64 `json:"health"`
	Income int     `json:"income"`
	Gold   int     `json:"gold"`

	Keybind string

	Faceset image.Image
	Sprite  image.Image
}

Jump to

Keyboard shortcuts

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