game

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamTypeLight = iota
	ParamTypeNone
)
View Source
const (
	ParamType2FlowingLiquid = iota
	ParamType2WallMounted
	ParamType2FaceDir
	ParamType2Leveled
	ParamType2DegRotate
	ParamType2MeshOptions
	ParamType2Color
	ParamType2ColorFaceDir
	ParamType2ColorWallMounted
	ParamType2GlassLikeLiquidLevel
	ParamType2ColorDegRotate
	ParamType2None
	ParamType2Waving
)

Variables

View Source
var DrawTypeNames = map[string]DrawType{
	"normal":                    DrawTypeNormal,
	"airlike":                   DrawTypeAirlike,
	"liquid":                    DrawTypeLiquid,
	"flowingliquid":             DrawTypeFlowingLiquid,
	"glasslike":                 DrawTypeGlasslike,
	"glasslike_framed":          DrawTypeGlasslikeFramed,
	"glasslike_framed_optional": DrawTypeGlasslikeFramed,
	"allfaces":                  DrawTypeAllFaces,
	"allfaces_optional":         DrawTypeAllFaces,
	"torchlike":                 DrawTypeTorchlike,
	"signlike":                  DrawTypeSignlike,
	"plantlike":                 DrawTypePlantlike,
	"firelike":                  DrawTypeFirelike,
	"fencelike":                 DrawTypeFencelike,
	"raillike":                  DrawTypeRaillike,
	"nodebox":                   DrawTypeNodeBox,
	"mesh":                      DrawTypeMesh,
	"plantlike_rooted":          DrawTypePlantlikeRooted,
}
View Source
var ParamType2Names = map[string]ParamType2{
	"flowingliquid":        ParamType2FlowingLiquid,
	"wallmounted":          ParamType2WallMounted,
	"facedir":              ParamType2FaceDir,
	"leveled":              ParamType2Leveled,
	"degrotate":            ParamType2DegRotate,
	"meshoptions":          ParamType2MeshOptions,
	"color":                ParamType2Color,
	"colorfacedir":         ParamType2ColorFaceDir,
	"colorwallmounted":     ParamType2ColorWallMounted,
	"glasslikeliquidlevel": ParamType2GlassLikeLiquidLevel,
	"colordegrotate":       ParamType2ColorDegRotate,
	"waving":               ParamType2Waving,
	"none":                 ParamType2None,
}
View Source
var ParamTypeNames = map[string]ParamType{
	"none":  ParamTypeNone,
	"light": ParamTypeLight,
}

Functions

This section is empty.

Types

type DrawType

type DrawType int
const (
	DrawTypeNormal DrawType = iota
	DrawTypeAirlike
	DrawTypeLiquid
	DrawTypeFlowingLiquid
	DrawTypeGlasslike
	DrawTypeGlasslikeFramed
	DrawTypeAllFaces
	DrawTypeTorchlike
	DrawTypeSignlike
	DrawTypePlantlike
	DrawTypeFirelike
	DrawTypeFencelike
	DrawTypeRaillike
	DrawTypeNodeBox
	DrawTypeMesh
	DrawTypePlantlikeRooted
)

func (DrawType) IsLiquid

func (t DrawType) IsLiquid() bool

func (*DrawType) UnmarshalJSON

func (t *DrawType) UnmarshalJSON(data []byte) error

type Game

type Game struct {
	Aliases map[string]string
	Nodes   map[string]NodeDefinition
	// contains filtered or unexported fields
}

func LoadGame

func LoadGame(desc string, path string) (Game, error)

func (*Game) NodeDef

func (g *Game) NodeDef(node string) NodeDefinition

type MediaCache

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

func NewMediaCache

func NewMediaCache() *MediaCache

func (*MediaCache) Image

func (m *MediaCache) Image(name string) *image.NRGBA

func (*MediaCache) Mesh

func (m *MediaCache) Mesh(name string) *mesh.Model

type NodeBox

type NodeBox struct {
	Type  string
	Fixed [][]float64
}

func (*NodeBox) UnmarshalJSON

func (n *NodeBox) UnmarshalJSON(data []byte) error

type NodeDefinition

type NodeDefinition struct {
	DrawType   DrawType
	ParamType  ParamType
	ParamType2 ParamType2
	Textures   []*image.NRGBA
	Model      *mesh.Model
}

func ResolveNode

func ResolveNode(descriptor NodeDescriptor, mediaCache *MediaCache) NodeDefinition

type NodeDescriptor

type NodeDescriptor struct {
	DrawType   DrawType   `json:"drawtype"`
	ParamType  ParamType  `json:"paramtype"`
	ParamType2 ParamType2 `json:"paramtype2"`
	Tiles      []string   `json:"tiles"`
	NodeBox    *NodeBox   `json:"node_box"`
	Mesh       *string    `json:"mesh"`
}

func (*NodeDescriptor) UnmarshalJSON

func (n *NodeDescriptor) UnmarshalJSON(data []byte) error

type ParamType

type ParamType int

func (*ParamType) UnmarshalJSON

func (t *ParamType) UnmarshalJSON(data []byte) error

type ParamType2

type ParamType2 int

func (*ParamType2) UnmarshalJSON

func (t *ParamType2) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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