| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- var LeagueStorage = &leagueStorageConfig{}
- func init() {
- _allList = append(_allList, LeagueStorage)
- }
- type (
- LeagueStorageRow struct {
- ID int32 `json:"ID"` // 资源ID
- InitRate int32 `json:"InitRate"` // 初始默认税率(百分比)
- MinRate int32 `json:"MinRate"` // 税率下限(百分比)
- MaxRate int32 `json:"MaxRate"` // 税率上限(百分比)
- AdjustTimes int32 `json:"AdjustTimes"` // 税率调整次数(每日)
- FBonusTimes int32 `json:"fBonusTimes"` // F币分红次数(每日)
- MinFBonus int64 `json:"MinFBonus"` // F币分红最小值
- }
- leagueStorageConfig struct {
- baseConfig
- list []*LeagueStorageRow // all list
- idUniMaps map[int32]*LeagueStorageRow // key:id
- }
- )
- func (p *leagueStorageConfig) Name() string {
- return "league_storage"
- }
- func (p *leagueStorageConfig) Init() {
- p.idUniMaps = map[int32]*LeagueStorageRow{}
- }
- func (p *leagueStorageConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*LeagueStorageRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- idUniMaps := map[int32]*LeagueStorageRow{}
- for _, row := range list {
- idUniMaps[row.ID] = row
- }
- p.idUniMaps = idUniMaps
- return len(list), nil
- }
- // func (p *leagueStorageConfig) OnAfterLoad(_ bool) {
- // }
- func (p *leagueStorageConfig) List() []*LeagueStorageRow {
- return p.list
- }
- func (p *leagueStorageConfig) GetByID(id int32) (*LeagueStorageRow, bool) {
- value, found := p.idUniMaps[id]
- return value, found
- }
- func (p *leagueStorageConfig) ContainID(id int32) bool {
- _, found := p.idUniMaps[id]
- return found
- }
|