table

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Generated by gitee.com/jackytse/tabtoy Version: 2.9.0 DO NOT EDIT!!

Index

Constants

This section is empty.

Variables

View Source
var (
	ActorTypeMapperValueByName = map[string]int32{
		"Leader": 0,
		"Monkey": 1,
		"Pig":    2,
		"Hammer": 3,
	}

	ActorTypeMapperNameByValue = map[int32]string{
		0: "Leader",
		1: "Monkey",
		2: "Pig",
		3: "Hammer",
	}

	ActorTypeCommentByValue = map[int32]string{
		0: "唐僧",
		1: "孙悟空",
		2: "猪八戒",
		3: "沙僧",
	}
)

Functions

This section is empty.

Types

type ActorType

type ActorType int32

Defined in table: Globals

const (

	// 唐僧
	ActorType_Leader ActorType = 0

	// 孙悟空
	ActorType_Monkey ActorType = 1

	// 猪八戒
	ActorType_Pig ActorType = 2

	// 沙僧
	ActorType_Hammer ActorType = 3
)

func (ActorType) String

func (self ActorType) String() string

type AttackParam

type AttackParam struct {

	// 攻击值
	Value int32
}

Defined in table: Sample

type Config

type Config struct {

	//Sample
	Sample []*SampleDefine
}

Defined in table: Config

type ConfigTable

type ConfigTable struct {

	// 表格原始数据
	Config

	SampleByID map[int64]*SampleDefine

	SampleByName map[string]*SampleDefine
	// contains filtered or unexported fields
}

Config 访问接口

func NewConfigTable

func NewConfigTable() *ConfigTable

创建一个Config表读取实例

func (*ConfigTable) Load

func (self *ConfigTable) Load(filename string) error

从json文件加载

func (*ConfigTable) LoadData

func (self *ConfigTable) LoadData(data []byte) error

从二进制加载

func (*ConfigTable) RegisterIndexEntry

func (self *ConfigTable) RegisterIndexEntry(name string, indexCallback func(*ConfigTable) error, clearCallback func(*ConfigTable) error)

注册外部索引入口, 索引回调, 清空回调

func (*ConfigTable) RegisterPostEntry

func (self *ConfigTable) RegisterPostEntry(callback func(*ConfigTable) error)

注册所有完成时回调

func (*ConfigTable) RegisterPreEntry

func (self *ConfigTable) RegisterPreEntry(callback func(*ConfigTable) error)

注册加载前回调

type Prop

type Prop struct {

	// 血量
	HP int32

	// 攻击速率
	AttackRate float32

	// 额外类型
	ExType ActorType
}

Defined in table: Sample

type SampleDefine

type SampleDefine struct {

	//唯一ID
	ID int64

	//名称
	Name string `自定义tag:"支持go的struct tag"`

	EmptyName string

	//图标ID
	IconID int32

	//攻击率
	NumericalRate float32

	//物品id
	ItemID int32

	//BuffID
	BuffID []int32

	//位置
	Pos *Vec2

	//类型
	Type ActorType

	//技能ID列表
	SkillID []int32

	//攻击参数
	AttackParam *AttackParam

	//单结构解析
	SingleStruct *Prop

	//字符串结构
	StrStruct []*Prop
}

Defined in table: Sample

type Vec2

type Vec2 struct {
	X int32

	Y int32
}

Defined in table: Globals

Jump to

Keyboard shortcuts

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