package rank

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

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

var PlayerCoinMgrInstance = com.NewListMgr[*model.RankPlayerCoin](
	func() int64 {
		return int64(model.GameParamData.RankTimeout)
	},
	func(platform string, index int32) ([]*model.RankPlayerCoin, error) {
		logger.Logger.Tracef("load rank player coin platform:%s", platform)
		list, err := model.FindPlayerCoinList(&model.FindPlayerCoinListArgs{
			Platform: platform,
		})
		if err != nil {
			return nil, err
		}
		return list.List, nil
	})
