| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- var ItemChest = &itemChestConfig{}
- func init() {
- _allList = append(_allList, ItemChest)
- }
- type (
- ItemChestRow struct {
- ID int32 `json:"ID"` // ID
- DropPoolID int32 `json:"DropPoolID"` // 掉落ID
- UseType int32 `json:"UseType"` // 使用类型
- }
- itemChestConfig struct {
- baseConfig
- list []*ItemChestRow // all list
- idUniMaps map[int32]*ItemChestRow // key:id
- }
- )
- func (p *itemChestConfig) Name() string {
- return "item_chest"
- }
- func (p *itemChestConfig) Init() {
- p.idUniMaps = map[int32]*ItemChestRow{}
- }
- func (p *itemChestConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*ItemChestRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- idUniMaps := map[int32]*ItemChestRow{}
- for _, row := range list {
- idUniMaps[row.ID] = row
- }
- p.idUniMaps = idUniMaps
- return len(list), nil
- }
- // func (p *itemChestConfig) OnAfterLoad(_ bool) {
- // }
- func (p *itemChestConfig) List() []*ItemChestRow {
- return p.list
- }
- func (p *itemChestConfig) GetByID(id int32) (*ItemChestRow, bool) {
- value, found := p.idUniMaps[id]
- return value, found
- }
- func (p *itemChestConfig) ContainID(id int32) bool {
- _, found := p.idUniMaps[id]
- return found
- }
|