savedata

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SaveData

type SaveData struct {
	// Doc stores the userfile XML data parsed as etree.Elements.
	// It shouldn't be modified, use a deep copy on export and operations.
	Doc *etree.Document

	MainPawn   entities.Pawn
	FirstPawn  entities.Pawn
	SecondPawn entities.Pawn
}

func NewSaveDataFromDataXML

func NewSaveDataFromDataXML(s *string) (*SaveData, error)

NewSaveDataFromDataXML creates a SaveData from a string containing the DataXML.

func (*SaveData) GetPawnMap

func (sd *SaveData) GetPawnMap(category string) (map[string]interface{}, error)

stackoverflow.com/a/17306470 and more annoyances. func (sd *SaveData) MarshalJSON() ([]byte, error).

func (*SaveData) PawnRootCount

func (sd *SaveData) PawnRootCount() (uint8, error)

PawnRootCount gets the count attribute from the parent array of the pawn tree. Tested with a new save and it's always 3, with zeroed values.

Jump to

Keyboard shortcuts

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