property

package
v0.0.0-...-0c1458e Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package property provides handling for the different property types that may be encountered within a Satisfactory save file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SerializeProperties

func SerializeProperties(props []*Property, d *data.Data) error

Types

type ArbitraryStruct

type ArbitraryStruct struct {
	Properties []*Property `json:"properties,omitempty"`
}

type ArrayPropertyValue

type ArrayPropertyValue struct {
	ValueType Type    `json:"value_type,omitempty"`
	Values    []Value `json:"values,omitempty"`

	StructName      string  `json:"struct_name,omitempty"`
	StructBytes     []byte  `json:"struct_bytes,omitempty"`
	StructInnerType string  `json:"struct_inner_type,omitempty"`
	StructGUID      []int32 `json:"struct_guid,omitempty"`
}

func (*ArrayPropertyValue) GetStructValues

func (v *ArrayPropertyValue) GetStructValues() ([]*StructPropertyValue, error)

type BoolPropertyValue

type BoolPropertyValue bool

type BoxStruct

type BoxStruct struct {
	Min     []float32 `json:"min,omitempty"`
	Max     []float32 `json:"max,omitempty"`
	IsValid bool      `json:"is_valid,omitempty"`
}

type BytePropertyValue

type BytePropertyValue struct {
	Type  string `json:"text,omitempty"`
	Value []byte `json:"Value,omitempty"`
	// contains filtered or unexported fields
}

type ColorStruct

type ColorStruct struct {
	B byte `json:"b,omitempty"`
	G byte `json:"g,omitempty"`
	R byte `json:"r,omitempty"`
	A byte `json:"a,omitempty"`
}

type DateTimeStruct

type DateTimeStruct int64

type DoublePropertyValue

type DoublePropertyValue float64

type EnumPropertyValue

type EnumPropertyValue struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"Value,omitempty"`
}

type FloatPropertyValue

type FloatPropertyValue float32

type FluidBoxStruct

type FluidBoxStruct float32

type GUIDStruct

type GUIDStruct []byte

type Int64PropertyValue

type Int64PropertyValue int64

type Int8PropertyValue

type Int8PropertyValue int8

type IntPropertyValue

type IntPropertyValue int32

type InterfacePropertyValue

type InterfacePropertyValue struct {
	LevelName string `json:"level_name"`
	PathName  string `json:"path_name"`
}

type InventoryItemStruct

type InventoryItemStruct struct {
	ItemName  string `json:"item_name,omitempty"`
	LevelName string `json:"level_name,omitempty"`
	PathName  string `json:"path_name,omitempty"`
	NumItems  int32  `json:"num_items,omitempty"`
}

type LinearColorStruct

type LinearColorStruct struct {
	R float32 `json:"r,omitempty"`
	G float32 `json:"g,omitempty"`
	B float32 `json:"b,omitempty"`
	A float32 `json:"a,omitempty"`
}

type MapPropertyValue

type MapPropertyValue struct {
	KeyType   Type            `json:"key_type,omitempty"`
	ValueType Type            `json:"value_type,omitempty"`
	Values    map[Value]Value `json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*MapPropertyValue) MarshalJSON

func (v *MapPropertyValue) MarshalJSON() ([]byte, error)

type NamePropertyValue

type NamePropertyValue string

type ObjectPropertyValue

type ObjectPropertyValue struct {
	LevelName string `json:"level_name,omitempty"`
	PathName  string `json:"path_name,omitempty"`
}

type Property

type Property struct {
	Name  string `json:"name"`
	Type  Type   `json:"type"`
	Index int32  `json:"index"`

	// The Value of the Property.
	//
	// Accessing the value can be achieved by calling the appropriate Get method
	// on the Property based on its Type.
	Value Value `json:"value"`
}

A Property within a save.Component or save.Entity

func ParseProperties

func ParseProperties(d *data.Data) ([]*Property, error)

func ParseProperty

func ParseProperty(d *data.Data) (*Property, error)

func (*Property) GetArrayValue

func (p *Property) GetArrayValue() (*ArrayPropertyValue, error)

func (*Property) GetBoolValue

func (p *Property) GetBoolValue() (bool, error)

func (*Property) GetByteValue

func (p *Property) GetByteValue() ([]byte, error)

func (*Property) GetDoubleValue

func (p *Property) GetDoubleValue() (float64, error)

func (*Property) GetEnumPropertyValue

func (p *Property) GetEnumPropertyValue() (*EnumPropertyValue, error)

func (*Property) GetFloatValue

func (p *Property) GetFloatValue() (float32, error)

func (*Property) GetInt64Value

func (p *Property) GetInt64Value() (int64, error)

func (*Property) GetInt8Value

func (p *Property) GetInt8Value() (int8, error)

func (*Property) GetIntValue

func (p *Property) GetIntValue() (int32, error)

func (*Property) GetInterfaceValue

func (p *Property) GetInterfaceValue() (*InterfacePropertyValue, error)

func (*Property) GetMapPropertyValue

func (p *Property) GetMapPropertyValue() (*MapPropertyValue, error)

func (*Property) GetNameValue

func (p *Property) GetNameValue() (string, error)

func (*Property) GetObjectValue

func (p *Property) GetObjectValue() (*ObjectPropertyValue, error)

func (*Property) GetStringValue

func (p *Property) GetStringValue() (string, error)

func (*Property) GetStructValue

func (p *Property) GetStructValue() (*StructPropertyValue, error)

func (*Property) GetTextValue

func (p *Property) GetTextValue() (*TextPropertyValue, error)

func (*Property) SerializeProperty

func (p *Property) SerializeProperty(d *data.Data) error

type QuatStruct

type QuatStruct struct {
	X float32 `json:"x,omitempty"`
	Y float32 `json:"y,omitempty"`
	Z float32 `json:"z,omitempty"`
	W float32 `json:"w,omitempty"`
}

type RailroadTrackPositionStruct

type RailroadTrackPositionStruct struct {
	LevelName string  `json:"levelName,omitempty"`
	PathName  string  `json:"pathName,omitempty"`
	Offset    float32 `json:"offset,omitempty"`
	Forward   float32 `json:"forward,omitempty"`
}

type StringPropertyValue

type StringPropertyValue string

type StructPropertyValue

type StructPropertyValue struct {
	GUID []int32    `json:"guid,omitempty"`
	Type StructType `json:"type,omitempty"`

	// Value of the Struct
	//
	// Accessing the value can be achieved by calling the appropriate Get method
	// on the StructPropertyValue based on its Type.
	Value StructValue `json:"value,omitempty"`
}

func (*StructPropertyValue) GetArbitraryStruct

func (v *StructPropertyValue) GetArbitraryStruct() (*ArbitraryStruct, error)

func (*StructPropertyValue) GetBoxStruct

func (v *StructPropertyValue) GetBoxStruct() (*BoxStruct, error)

func (*StructPropertyValue) GetColorStruct

func (v *StructPropertyValue) GetColorStruct() (*ColorStruct, error)

func (*StructPropertyValue) GetDateTimeStruct

func (v *StructPropertyValue) GetDateTimeStruct() (*DateTimeStruct, error)

func (*StructPropertyValue) GetFluidBoxStruct

func (v *StructPropertyValue) GetFluidBoxStruct() (*FluidBoxStruct, error)

func (*StructPropertyValue) GetGUIDStruct

func (v *StructPropertyValue) GetGUIDStruct() (*GUIDStruct, error)

func (*StructPropertyValue) GetInventoryItemStruct

func (v *StructPropertyValue) GetInventoryItemStruct() (*InventoryItemStruct, error)

func (*StructPropertyValue) GetLinearColor

func (v *StructPropertyValue) GetLinearColor() (*LinearColorStruct, error)

func (*StructPropertyValue) GetQuatStruct

func (v *StructPropertyValue) GetQuatStruct() (*QuatStruct, error)

func (*StructPropertyValue) GetRailroadTrackPositionStruct

func (v *StructPropertyValue) GetRailroadTrackPositionStruct() (*RailroadTrackPositionStruct, error)

func (*StructPropertyValue) GetVector2DStruct

func (v *StructPropertyValue) GetVector2DStruct() (*Vector2DStruct, error)

func (*StructPropertyValue) GetVectorStruct

func (v *StructPropertyValue) GetVectorStruct() (*VectorStruct, error)

type StructType

type StructType string
const (
	BoxStructType                   StructType = "Box"
	ColorStructType                 StructType = "Color"
	DateTimeStructType              StructType = "DateTime"
	FluidBoxStructType              StructType = "FluidBox"
	GUIDStructType                  StructType = "GUID"
	InventoryItemStructType         StructType = "InventoryItem"
	LinearColorStructType           StructType = "LinearColor"
	QuatStructType                  StructType = "Quat"
	RailroadTrackPositionStructType StructType = "RailroadTrackPosition"
	VectorStructType                StructType = "Vector"
	Vector2DStructType              StructType = "Vector2D"
)

type StructValue

type StructValue interface {
	// contains filtered or unexported methods
}

type TextBase

type TextBase struct {
	Namespace string `json:"namespace,omitempty"`
	Key       string `json:"key,omitempty"`
	Value     string `json:"value,omitempty"`
}

type TextNone

type TextNone struct {
	CultureInvariantString int32  `json:"culture_invariant_string,omitempty"`
	String                 string `json:"string,omitempty"`
}

type TextPropertyValue

type TextPropertyValue struct {
	Flags int32     `json:"flags"`
	Type  TextType  `json:"type"`
	Value TextValue `json:"value"`
}

func (*TextPropertyValue) GetBaseText

func (t *TextPropertyValue) GetBaseText() (*TextBase, error)

func (*TextPropertyValue) GetNoneText

func (t *TextPropertyValue) GetNoneText() (*TextNone, error)

type TextType

type TextType byte
const (
	NoneTextType TextType = 0xFF
	BaseTextType TextType = 0x00
)

type TextValue

type TextValue interface {
	// contains filtered or unexported methods
}

type Type

type Type string

Type of a Property

const (
	ArrayPropertyType     Type = "ArrayProperty"
	BoolPropertyType      Type = "BoolProperty"
	BytePropertyType      Type = "ByteProperty"
	DoublePropertyType    Type = "DoubleProperty"
	EnumPropertyType      Type = "EnumProperty"
	FloatPropertyType     Type = "FloatProperty"
	Int8PropertyType      Type = "Int8Property"
	Int64PropertyType     Type = "Int64Property"
	InterfacePropertyType Type = "InterfaceProperty"
	IntPropertyType       Type = "IntProperty"
	MapPropertyType       Type = "MapProperty"
	NamePropertyType      Type = "NameProperty"
	ObjectPropertyType    Type = "ObjectProperty"
	StringPropertyType    Type = "StrProperty"
	StructPropertyType    Type = "StructProperty"
	TextPropertyType      Type = "TextProperty"
)

type Value

type Value interface {
	// contains filtered or unexported methods
}

Value of a Property

type Vector2DStruct

type Vector2DStruct struct {
	X float32 `json:"x,omitempty"`
	Y float32 `json:"y,omitempty"`
}

type VectorStruct

type VectorStruct struct {
	X float32 `json:"x,omitempty"`
	Y float32 `json:"y,omitempty"`
	Z float32 `json:"z,omitempty"`
}

Jump to

Keyboard shortcuts

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