带有座位号的房间实现

This commit is contained in:
kercylan98
2023-05-11 20:21:12 +08:00
parent 47f2267918
commit dfa5f7a063
3 changed files with 108 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
package game
// RoomSeat 带有座位号的房间实现
type RoomSeat[PlayerID comparable, P Player[PlayerID]] interface {
Room[PlayerID, P]
// SetSeat 设置玩家座位号
SetSeat(id PlayerID, seat int) error
// GetSeat 获取玩家座位号
GetSeat(id PlayerID) (int, error)
// GetPlayerWithSeat 根据座位号获取玩家
GetPlayerWithSeat(seat int) (P, error)
}