Documentation ¶
Overview ¶
Package balance implements parsing of Nox gamedata.bin files.
Index ¶
Constants ¶
const ( TagSolo = "SOLO" // tag for solo games TagArena = "ARENA" // tag for multiplayer games )
const (
// GamedataFile is a default filename for Nox balance file.
GamedataFile = "gamedata.bin"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { // Global config values that does not depend on tags. Global Config // Tags contain config overrides for specific tag values. Tags map[Tag]Config // Parent is a reference to a parent config. // It can be used to overlay values from one config with the other one. Parent *File }
File represents a parsed balance config file.
func ReadBalance ¶
ReadBalance reads a specified balance file. It expects the path to point to gamedata.bin. It will also read gamedata.yml and will use it as an overlay for the base file (if any).
func (*File) Array ¶
Array returns a float slice value for a given tag and key. If key is not set or has a different type, zero and false is returned.
For lookup rules, see Value.
func (*File) ArrayDef ¶
ArrayDef returns a float slice value for a given tag and key. If key is not set or has a different type, default value will be used.
For lookup rules, see Value.
func (*File) Float ¶
Float returns a float value for a given tag and key. If key is not set or has a different type, zero and false is returned.
For lookup rules, see Value.