roomSystem

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoom

func NewRoom(playerSessions []face.ISession, OnSpawn func(face.IRoom), OnDelete func(face.IRoom)) face.IRoom

func NewRoomStateConfirm

func NewRoomStateConfirm(room face.IRoom, length int) face.IRoomState

func NewRoomStateFight

func NewRoomStateFight(room face.IRoom, length int) face.IRoomState

func NewRoomStateLoadResource

func NewRoomStateLoadResource(room face.IRoom, length int) face.IRoomState

func NewRoomStateSelect

func NewRoomStateSelect(room face.IRoom, length int) face.IRoomState

Types

type Room

type Room struct {
	// contains filtered or unexported fields
}

a single room

func (*Room) Broadcast

func (room *Room) Broadcast(data []byte)

func (*Room) ChangePlayersRoomId

func (room *Room) ChangePlayersRoomId()

func (*Room) ChangeRoomState

func (room *Room) ChangeRoomState(newState int)

func (*Room) Delete

func (room *Room) Delete()

func (*Room) GetCurrentState

func (room *Room) GetCurrentState() face.IRoomState

func (*Room) GetPlayerIndex

func (room *Room) GetPlayerIndex(session face.ISession) int

func (*Room) GetRoomId

func (room *Room) GetRoomId() uint32

func (*Room) GetRoomPlayerCount

func (room *Room) GetRoomPlayerCount() int

func (*Room) GetSelectData

func (room *Room) GetSelectData() []int

func (*Room) SendFightStart

func (room *Room) SendFightStart()

func (*Room) SendLoadResource

func (room *Room) SendLoadResource()

func (*Room) SetSelectData

func (room *Room) SetSelectData(selectArr []int)

func (*Room) Start

func (room *Room) Start()

type RoomState

type RoomState int

type RoomStateConfirm

type RoomStateConfirm struct {
	// contains filtered or unexported fields
}

func (*RoomStateConfirm) CheckAllConfirm

func (state *RoomStateConfirm) CheckAllConfirm() bool

func (*RoomStateConfirm) CheckTimeLimit

func (state *RoomStateConfirm) CheckTimeLimit()

func (*RoomStateConfirm) Dismiss

func (state *RoomStateConfirm) Dismiss()

func (*RoomStateConfirm) Enter

func (state *RoomStateConfirm) Enter()

func (*RoomStateConfirm) Exit

func (state *RoomStateConfirm) Exit()

func (*RoomStateConfirm) Update

func (state *RoomStateConfirm) Update(sesssion face.ISession, mes *pb.PbMessage)

type RoomStateEnd

type RoomStateEnd struct {
	// contains filtered or unexported fields
}

func (*RoomStateEnd) Enter

func (state *RoomStateEnd) Enter()

func (*RoomStateEnd) Exit

func (state *RoomStateEnd) Exit()

func (*RoomStateEnd) Update

func (state *RoomStateEnd) Update(sid uint32, mes *pb.PbMessage)

type RoomStateFight

type RoomStateFight struct {
	// contains filtered or unexported fields
}

func (*RoomStateFight) CheckAllFightDone

func (state *RoomStateFight) CheckAllFightDone() bool

func (*RoomStateFight) Enter

func (state *RoomStateFight) Enter()

func (*RoomStateFight) Exit

func (state *RoomStateFight) Exit()

func (*RoomStateFight) ResponseFightEnd

func (state *RoomStateFight) ResponseFightEnd(playerIndex int)

func (*RoomStateFight) SyncLogicFrame

func (state *RoomStateFight) SyncLogicFrame()

func (*RoomStateFight) Update

func (state *RoomStateFight) Update(sesssion face.ISession, mes *pb.PbMessage)

type RoomStateLoadResource

type RoomStateLoadResource struct {
	// contains filtered or unexported fields
}

func (*RoomStateLoadResource) CheckAllLoadDone

func (state *RoomStateLoadResource) CheckAllLoadDone() bool

func (*RoomStateLoadResource) Enter

func (state *RoomStateLoadResource) Enter()

func (*RoomStateLoadResource) Exit

func (state *RoomStateLoadResource) Exit()

func (*RoomStateLoadResource) Update

func (state *RoomStateLoadResource) Update(session face.ISession, mes *pb.PbMessage)

type RoomStateSelect

type RoomStateSelect struct {
	// contains filtered or unexported fields
}

func (*RoomStateSelect) CheckAllSelectDone

func (state *RoomStateSelect) CheckAllSelectDone() bool

func (*RoomStateSelect) CheckTimeLimit

func (state *RoomStateSelect) CheckTimeLimit()

func (*RoomStateSelect) Dismiss

func (state *RoomStateSelect) Dismiss()

func (*RoomStateSelect) Enter

func (state *RoomStateSelect) Enter()

func (*RoomStateSelect) Exit

func (state *RoomStateSelect) Exit()

func (*RoomStateSelect) Update

func (state *RoomStateSelect) Update(session face.ISession, mes *pb.PbMessage)

type SelectData

type SelectData struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL