新增获取玩家数量接口

This commit is contained in:
kercylan98
2023-05-09 18:56:06 +08:00
parent f1488fe7d3
commit da77329799
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -43,6 +43,10 @@ func (slf *Room[PlayerID, Player]) GetPlayers() synchronization.MapReadonly[Play
return slf.players
}
func (slf *Room[PlayerID, Player]) GetPlayerCount() int {
return slf.players.Size()
}
func (slf *Room[PlayerID, Player]) IsExistPlayer(id PlayerID) bool {
return slf.players.Exist(id)
}