Documentation ¶
Index ¶
- Variables
- func NewRobotAirfone(t *Table, logger log.Logger) *roboAirfone
- type Airfone
- type Card
- type CardColor
- type CardDealer
- type CardValue
- type Cards
- type CardsType
- type Logger
- type Player
- type PlayerInfo
- type Room
- type RoomClass
- type RoomOptions
- type Seat
- type SeatCode
- type Table
- type TableId
- type TableOptions
- type UserCenter
- type UserID
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorRoomTableExceed = errors.New("tables of room exceed the limit") ErrorNotOnTable = errors.New("not on table") )
Functions ¶
func NewRobotAirfone ¶
Types ¶
type CardDealer ¶
type CardDealer struct {
// contains filtered or unexported fields
}
func NewCardDealer ¶
func NewCardDealer() *CardDealer
type Player ¶
type PlayerInfo ¶
type Room ¶
type Room struct { RoomOptions Tables map[TableId]*Table // contains filtered or unexported fields }
func NewRoom ¶
func NewRoom(op RoomOptions, logger Logger, userCenter UserCenter) (r *Room)
NewRoom 创建新房间
type RoomOptions ¶
type Table ¶
type Table struct { //牌桌配置 TableOptions //玩家管理 Seats map[Seat]UserID Players map[UserID]*Player //牌局状态 Status int //外部依赖 UCenter UserCenter // contains filtered or unexported fields }
func NewTable ¶
func NewTable(option TableOptions, logger Logger, userCenter UserCenter) (t *Table)
NewTable 新建牌桌
type TableOptions ¶
type UserCenter ¶
type UserCenter interface {
GetInfo(id UserID) (info *PlayerInfo, err error)
}
Click to show internal directories.
Click to hide internal directories.