genworld

package module
v0.0.0-...-3c3a78c Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

README

genworld

generator a world

Documentation

Index

Constants

View Source
const Version = "v0.1.5"

Version -

Variables

This section is empty.

Functions

func Proc

func Proc(lang language.Tag)

Types

type Category

type Category struct {
	Node `yaml:",inline"`
}

Category - 大类,属于核心设定

type Node

type Node struct {
	Name     string   `yaml:"name"`
	CodeID   string   `yaml:"codeID"`
	TagID    []string `yaml:"tagID"` // 这里属于标记,一个节点,可以有多个标记,至于标记的具体用途,可以自由定义
	Info     string   `yaml:"info"`
	ParentID []string `yaml:"parentID"` // 因为这里可能是多个父节点的,所以下面children也应该用codeid来标识
	Children []*Node  `yaml:"-"`        // 因为是多对多的,所以有parent就足以定位了,这里的Children是载入后再建立起的数据
	Status   *Status  `yaml:"status"`
}

func (*Node) Each

func (node *Node) Each(oneach func(*Node))

type NodeMgr

type NodeMgr struct {
	MapNodes map[string]*Node `yaml:"-"`
	Nodes    []*Node          `yaml:"nodes"`
}

func LoadNodeMgr

func LoadNodeMgr(fn string) (*NodeMgr, error)

func (*NodeMgr) Merge

func (mgr *NodeMgr) Merge(mgr1 *NodeMgr)

func (*NodeMgr) RebuildChildren

func (mgr *NodeMgr) RebuildChildren()

type Status

type Status struct {
	MapInt map[string]int    `yaml:"vals"`
	MapStr map[string]string `yaml:"strs"`
}

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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