entities

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

func NameStrToString

func NameStrToString(nameStr types.U8Array) string

NameStrToString converts a NameStr U8Array to a string.

Types

type AppearanceOverride

type AppearanceOverride struct {
	Element    *etree.Element `json:"-"`
	DataXML    string
	Attributes Attributes
}

mEditPawn (main pawn appearance override). TODO remove DataXML and use Element.

func NewAppearanceOverrideFromRootNode

func NewAppearanceOverrideFromRootNode(root *etree.Element, parent string) (*AppearanceOverride, error)

NewAppearanceOverrideFromRootNode creates a new appearance override from their root node. Parent: mEdit, mEditPawn, so it can be reused without reparsing AOs from different sources.

type Attributes

type Attributes struct {
	Name     string
	NameStr  types.U8Array `json:"-"`
	Nickname types.U32
	Gender   types.U8
}

type Pawn

type Pawn struct {
	Category           PawnCategory
	Element            *etree.Element `json:"-"`
	Attributes         Attributes
	AppearanceOverride AppearanceOverride
}

func NewPawnFromDataXML

func NewPawnFromDataXML(dataXML string, c string) (*Pawn, error)

NewPawnFromDataXML creates a new pawn from DataXML (string of the root node of a pawn).

func NewPawnFromRootNode

func NewPawnFromRootNode(root *etree.Element, c PawnCategory) (*Pawn, error)

NewPawnFromRootNode creates a new pawn from their root node.

func (*Pawn) ToBytes

func (p *Pawn) ToBytes() ([]byte, error)

ToBytes returns the pawn tree elements DataXML as bytes.

func (*Pawn) ToDataXML

func (p *Pawn) ToDataXML() (string, error)

ToDataXML returns the pawn tree elements DataXML.

type PawnCategory

type PawnCategory string

PawnCategory is an enum of pawn categories.

const (
	MainPawn   PawnCategory = "MAIN_PAWN"
	FirstPawn  PawnCategory = "FIRST_PAWN"
	SecondPawn PawnCategory = "SECOND_PAWN"
)

func ToPawnCategory

func ToPawnCategory(c string) (*PawnCategory, error)

ToPawnCategory returns the PawnCategory from a string (the frontend representation).

Jump to

Keyboard shortcuts

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