package baseroom

import (
	"game/common/proto/pb"
	"github.com/fox/fox/service"
)

type IRoom interface {
	Id() int
	RoomType() int // 房间配置id
	GameId() int
	OnInit()
	// SeatPlayerNum() int
	// FindEmptySeat() bool
	// FindPlayer(uid int64) bool
	Unmarshal(cmd int32, data []byte) (any, error)
	Dispatch(user IPlayer, cmd int32, params ...any) error
	// ReleaseRoom()
}

type ISeat interface {
	No() int
	Empty() bool
	Player() IPlayer
	SetPlayer(player IPlayer)
	Status() SeatStatus
	SetStatus(status SeatStatus)
}

type IPlayer interface {
	Id() int64
	Robot() IRobot
	IsRobot() bool
	RoomId() int
}

type IRobot interface {
	OnMessage(cmd pb.MsgId, params ...any)
}

type ICreateRoom interface {
	CreateRoom(id, roomType int, service service.IService) (IRoom, pb.ErrCode)
}

type ICreatePlayer interface {
	CreatePlayer(id int64) (IPlayer, pb.ErrCode)
}
