更多的辅助函数、补位模式
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user