Documentation ¶
Index ¶
- Constants
- Variables
- func LoadAllCfgs(dir string, loadFilter func(f string) bool) bool
- func LoadCfgFilter(fileName string) bool
- func Register(cfgMgrCtorLoader func() any, order Order) *atomic.Value
- type ActivityCfgMgr
- func (m *ActivityCfgMgr) GetActivityCfg(cfgId int32) *pb.ActivityCfg
- func (m *ActivityCfgMgr) GetConditionMgr() *ConditionMgr
- func (m *ActivityCfgMgr) GetProgressMgr() *ProgressMgr
- func (m *ActivityCfgMgr) SetConditionMgr(conditionMgr *ConditionMgr)
- func (m *ActivityCfgMgr) SetProgressMgr(progressMgr *ProgressMgr)
- type AfterLoader
- type DataMap
- func (this *DataMap[E]) GetCfg(cfgId int32) E
- func (this *DataMap[E]) Load(fileName string, loaderOption *LoaderOption) error
- func (this *DataMap[E]) LoadCsv(fileName string, option *csv.CsvOption) error
- func (this *DataMap[E]) LoadJson(fileName string) error
- func (this *DataMap[E]) Range(f func(e E) bool)
- type DataSlice
- func (this *DataSlice[E]) GetCfg(index int) E
- func (this *DataSlice[E]) Len() int
- func (this *DataSlice[E]) Load(fileName string, loaderOption *LoaderOption) error
- func (this *DataSlice[E]) LoadCsv(fileName string, option *csv.CsvOption) error
- func (this *DataSlice[E]) LoadJson(fileName string) error
- func (this *DataSlice[E]) Range(f func(e E) bool)
- type ItemCfgMgr
- type LevelCfgMgr
- type Loader
- type LoaderOption
- type Order
- type QuestCfgMgr
- func (m *QuestCfgMgr) AfterLoad()
- func (m *QuestCfgMgr) GetConditionMgr() *ConditionMgr
- func (m *QuestCfgMgr) GetProgressMgr() *ProgressMgr
- func (m *QuestCfgMgr) GetQuestCfg(cfgId int32) *pb.QuestCfg
- func (m *QuestCfgMgr) SetConditionMgr(conditionMgr *ConditionMgr)
- func (m *QuestCfgMgr) SetProgressMgr(progressMgr *ProgressMgr)
- type TemplateCfgMgr
Constants ¶
View Source
const (
Tag = "cfg"
)
Variables ¶
View Source
var DefaultCsvOption = csv.DefaultOption
默认csv设置
Functions ¶
func LoadAllCfgs ¶
加载所有注册的数据,支持热更新
Types ¶
type ActivityCfgMgr ¶
type ActivityCfgMgr struct { *DataMap[*pb.ActivityCfg] `cfg:"activitycfg.csv"` // contains filtered or unexported fields }
活动配置数据管理
func (*ActivityCfgMgr) GetActivityCfg ¶
func (m *ActivityCfgMgr) GetActivityCfg(cfgId int32) *pb.ActivityCfg
func (*ActivityCfgMgr) GetConditionMgr ¶
func (m *ActivityCfgMgr) GetConditionMgr() *ConditionMgr
func (*ActivityCfgMgr) GetProgressMgr ¶
func (m *ActivityCfgMgr) GetProgressMgr() *ProgressMgr
func (*ActivityCfgMgr) SetConditionMgr ¶
func (m *ActivityCfgMgr) SetConditionMgr(conditionMgr *ConditionMgr)
func (*ActivityCfgMgr) SetProgressMgr ¶
func (m *ActivityCfgMgr) SetProgressMgr(progressMgr *ProgressMgr)
type AfterLoader ¶
type AfterLoader interface {
AfterLoad()
}
type DataMap ¶
map类型的配置数据管理
func (*DataMap[E]) Load ¶
func (this *DataMap[E]) Load(fileName string, loaderOption *LoaderOption) error
加载配置数据,支持json和csv
type DataSlice ¶
type DataSlice[E any] struct { // contains filtered or unexported fields }
slice类型的配置数据管理
func (*DataSlice[E]) Load ¶
func (this *DataSlice[E]) Load(fileName string, loaderOption *LoaderOption) error
加载配置数据,支持json和csv
type ItemCfgMgr ¶
任务配置数据管理
type LevelCfgMgr ¶
等级配置数据管理
type Loader ¶
type Loader interface {
Load(fileName string, loaderOption *LoaderOption) error
}
type LoaderOption ¶
type QuestCfgMgr ¶
type QuestCfgMgr struct { *DataMap[*pb.QuestCfg] `cfg:"questcfg.csv"` // contains filtered or unexported fields }
任务配置数据管理
func (*QuestCfgMgr) AfterLoad ¶
func (m *QuestCfgMgr) AfterLoad()
func (*QuestCfgMgr) GetConditionMgr ¶
func (m *QuestCfgMgr) GetConditionMgr() *ConditionMgr
func (*QuestCfgMgr) GetProgressMgr ¶
func (m *QuestCfgMgr) GetProgressMgr() *ProgressMgr
func (*QuestCfgMgr) GetQuestCfg ¶
func (m *QuestCfgMgr) GetQuestCfg(cfgId int32) *pb.QuestCfg
func (*QuestCfgMgr) SetConditionMgr ¶
func (m *QuestCfgMgr) SetConditionMgr(conditionMgr *ConditionMgr)
func (*QuestCfgMgr) SetProgressMgr ¶
func (m *QuestCfgMgr) SetProgressMgr(progressMgr *ProgressMgr)
type TemplateCfgMgr ¶
type TemplateCfgMgr struct { ConditionTemplates *DataMap[*pb.ConditionTemplateCfg] `cfg:"condition_template.csv"` ProgressTemplates *DataMap[*pb.ProgressTemplateCfg] `cfg:"progress_template.csv"` Exchanges *DataMap[*pb.ExchangeCfg] `cfg:"exchange.csv"` }
模板配置数据管理
func (*TemplateCfgMgr) AfterLoad ¶
func (m *TemplateCfgMgr) AfterLoad()
func (*TemplateCfgMgr) GetExchangeCfg ¶
func (m *TemplateCfgMgr) GetExchangeCfg(cfgId int32) *pb.ExchangeCfg
Click to show internal directories.
Click to hide internal directories.