package rank

import (
	"mongo.games.com/goserver/core/logger"

	"mongo.games.com/game/model"
	"mongo.games.com/game/ranksrv/com"
)

var RankLevelMgrInstance = com.NewListMgr[*model.PlayerRankScore](
	func() int64 {
		return int64(model.GameParamData.RankTimeout)
	},
	func(platform string, index int32) ([]*model.PlayerRankScore, error) {
		logger.Logger.Tracef("load rank level platform:%s rankType:%d", platform, index)
		seasonList, err := model.FindPlayerRankSeasonList(&model.FindPlayerRankSeasonListArgs{
			Platform: platform,
			RankType: index,
		})
		if err != nil {
			return nil, err
		}
		return seasonList.List, nil
	})
