// Code generated by excel export. DO NOT EDIT. package data import ( "f1-game/internal/types" ) var Shop = &shopConfig{} func init() { _allList = append(_allList, Shop) } type ( ShopRow struct { ShopID int32 `json:"ShopID"` // 商店ID ShopType int32 `json:"ShopType"` // 商店类型 ResetType int32 `json:"ResetType"` // 重置类型 UnlockType int32 `json:"UnlockType"` // 解锁类型 UnlockValue int32 `json:"UnlockValue"` // 解锁值 ShopPools types.PairList[int32, int32] `json:"ShopPools"` // 商品库 } shopConfig struct { baseConfig list []*ShopRow // all list shopIDUniMaps map[int32]*ShopRow // key:shopID } ) func (p *shopConfig) Name() string { return "shop" } func (p *shopConfig) Init() { p.shopIDUniMaps = map[int32]*ShopRow{} } func (p *shopConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*ShopRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list shopIDUniMaps := map[int32]*ShopRow{} for _, row := range list { shopIDUniMaps[row.ShopID] = row } p.shopIDUniMaps = shopIDUniMaps return len(list), nil } // func (p *shopConfig) OnAfterLoad(_ bool) { // } func (p *shopConfig) List() []*ShopRow { return p.list } func (p *shopConfig) GetByShopID(shopID int32) (*ShopRow, bool) { value, found := p.shopIDUniMaps[shopID] return value, found } func (p *shopConfig) ContainShopID(shopID int32) bool { _, found := p.shopIDUniMaps[shopID] return found }