// Code generated by excel export. DO NOT EDIT. package data import ( "f1-game/internal/types" ) var Recruit = &recruitConfig{} func init() { _allList = append(_allList, Recruit) } type ( RecruitRow struct { ID int32 `json:"ID"` // ID CostItemID int32 `json:"CostItemID"` // 消耗道具ID CostX1 int32 `json:"CostX1"` // 单抽消耗 CostX5 int32 `json:"CostX5"` // 五连消耗 CostX10 int32 `json:"CostX10"` // 十连消耗 Rewards types.Assets `json:"Rewards"` // 奖励 NormalPool int32 `json:"NormalPool"` // 卡池ID MidFloorNum int32 `json:"MidFloorNum"` // 小保底次数 MidFloorPool int32 `json:"MidFloorPool"` // 小保底池 FinalFloorNum int32 `json:"FinalFloorNum"` // 大保底次数 FinalFloorPool int32 `json:"FinalFloorPool"` // 大保底池 } recruitConfig struct { baseConfig list []*RecruitRow // all list idUniMaps map[int32]*RecruitRow // key:id } ) func (p *recruitConfig) Name() string { return "recruit" } func (p *recruitConfig) Init() { p.idUniMaps = map[int32]*RecruitRow{} } func (p *recruitConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*RecruitRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list idUniMaps := map[int32]*RecruitRow{} for _, row := range list { idUniMaps[row.ID] = row } p.idUniMaps = idUniMaps return len(list), nil } // func (p *recruitConfig) OnAfterLoad(_ bool) { // } func (p *recruitConfig) List() []*RecruitRow { return p.list } func (p *recruitConfig) GetByID(id int32) (*RecruitRow, bool) { value, found := p.idUniMaps[id] return value, found } func (p *recruitConfig) ContainID(id int32) bool { _, found := p.idUniMaps[id] return found }