更多的辅助函数、补位模式

This commit is contained in:
kercylan98
2023-05-12 10:00:01 +08:00
parent dfa5f7a063
commit 46017d8bc0
3 changed files with 83 additions and 2 deletions
+8
View File
@@ -9,4 +9,12 @@ type RoomSeat[PlayerID comparable, P Player[PlayerID]] interface {
GetSeat(id PlayerID) (int, error)
// GetPlayerWithSeat 根据座位号获取玩家
GetPlayerWithSeat(seat int) (P, error)
// GetSeatInfo 获取座位信息,空缺的位置将为空
GetSeatInfo() []*PlayerID
// GetSeatInfoMap 以map的方式获取座位号
GetSeatInfoMap() map[int]PlayerID
// GetSeatInfoMapVacancy 以map的方式获取座位号,空缺的位置将被保留为nil
GetSeatInfoMapVacancy() map[int]*PlayerID
// GetSeatInfoWithPlayerIDMap 获取座位信息,将以玩家ID作为key
GetSeatInfoWithPlayerIDMap() map[PlayerID]int
}