package srvdata

var PlayerExpMgr = &DB_PlayerExpMgrEx{ArtilleryRateMap: make(map[int32]*ArtilleryRateData)}

type ArtilleryRateData struct {
	Shell int32
	Level int32
}

type DB_PlayerExpMgrEx struct {
	ArtilleryRateMap map[int32]*ArtilleryRateData
}

func (this *DB_PlayerExpMgrEx) Load(fileFullPath string) error {
	this.ArtilleryRateMap = make(map[int32]*ArtilleryRateData)
	for _, data := range PBDB_ArtilleryRateMgr.Datas.Arr {
		this.ArtilleryRateMap[data.Level] = &ArtilleryRateData{
			Shell: data.Shell,
			Level: data.Level,
		}
	}
	return nil
}

// 获取解锁的炮倍
func (this *DB_PlayerExpMgrEx) GetUnPower(level int32) int32 {
	if this.ArtilleryRateMap[level] != nil {
		return this.ArtilleryRateMap[level].Shell
	}
	return 0
}

func (this *DB_PlayerExpMgrEx) Reload(fileFullPath string) error {
	return this.Load(fileFullPath)
}

func init() {
	DataMgrAfter.RegisterLoader("DB_PlayerExp.dat", PlayerExpMgr)
}
