排名改变事件实现

This commit is contained in:
kercylan98
2023-05-30 15:21:44 +08:00
parent 360f07d9ae
commit 4e75282d01
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -29,6 +29,7 @@ type RankingList[CompetitorID comparable, Score generic.Ordered] interface {
Clear()
// RegRankChangeEvent 排名改变时将立即执行注册的事件处理函数
// - 当竞争者为新加入时,oldRank 和 oldScore 均与 newRank 和 newScore 相同
RegRankChangeEvent(handle RankChangeEventHandle[CompetitorID, Score])
OnRankChangeEvent(competitorId CompetitorID, oldRank, newRank int, oldScore, newScore Score)
}