Files
AynaLivePlayer/controller/liveroom.go
2022-12-23 05:06:57 -08:00

31 lines
763 B
Go

package controller
import (
"AynaLivePlayer/common/event"
"AynaLivePlayer/liveclient"
"AynaLivePlayer/model"
)
type DanmuCommandExecutor interface {
Match(command string) bool
Execute(command string, args []string, danmu *liveclient.DanmuMessage)
}
type ILiveRoomController interface {
Size() int
Get(index int) ILiveRoom
GetRoomStatus(index int) bool
Connect(index int) error
Disconnect(index int) error
AddRoom(clientName, roomId string) (*model.LiveRoom, error)
DeleteRoom(index int) error
AddDanmuCommand(executor DanmuCommandExecutor)
}
type ILiveRoom interface {
Model() *model.LiveRoom // should return mutable model (not a copy)
Title() string // should be same as Model().Title
Status() bool
EventManager() *event.Manager
}