config

package
v0.0.0-...-eba1a7b Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Created by xuzhuoxi on 2019-06-09. @author xuzhuoxi

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entities

type Entities struct {
	Worlds []Entity `json:"worlds"`
	Zones  []Entity `json:"zones"`
	Rooms  []Entity `json:"rooms"`
}

type Entity

type Entity struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	MaxUser int    `json:"max"`
}

type MMO

type MMO struct {
	World string `json:"world"`
	Zones []Zone `json:"zones"`

	WorldEntity  *Entity
	ZoneEntities []*Entity
	RoomEntities []*Entity
	// contains filtered or unexported fields
}

func (*MMO) GetEntity

func (m *MMO) GetEntity(entityId string) (entity *Entity, ok bool)

type MMOConfig

type MMOConfig struct {
	Entities Entities `json:"entities"`
	MMO      MMO      `json:"mmo"`
}
var DefaultMMOConfig *MMOConfig

func ParseMMOConfigByContent

func ParseMMOConfigByContent(content []byte) *MMOConfig

func ParseMMOConfigByFlag

func ParseMMOConfigByFlag(flagSet *cmdx.FlagSetExtend) *MMOConfig

func ParseMMOConfigByPath

func ParseMMOConfigByPath(path string) *MMOConfig

func (*MMOConfig) HandleData

func (c *MMOConfig) HandleData()

type Zone

type Zone struct {
	ZoneId string   `json:"zone"`
	Rooms  []string `json:"rooms"`
}

Jump to

Keyboard shortcuts

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