msgbox

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName = "MsgboxService"
)

Variables

This section is empty.

Functions

func RegisterService

func RegisterService()

RegisterService registeres MsgboxService to goworld

Types

type Msg

type Msg map[string]interface{}

type Msgbox

type Msgbox struct {
	entity.Component
	// contains filtered or unexported fields
}

Msgbox is used to send messages among entities: e.x. Msgbox{&a.Entity}.Send(targetID, msg, callback)

func (*Msgbox) MsgboxOnRecvMsg

func (mb *Msgbox) MsgboxOnRecvMsg(beginMsgId int64, endMsgId int64, msgs []Msg)

func (*Msgbox) OnInit

func (mb *Msgbox) OnInit()

func (*Msgbox) Recv

func (mb *Msgbox) Recv()

func (*Msgbox) Send

func (mb *Msgbox) Send(targetID common.EntityID, msg Msg)

func (*Msgbox) SetMsgHandler

func (mb *Msgbox) SetMsgHandler(handler func(msg Msg))

type MsgboxService

type MsgboxService struct {
	entity.Entity
}

func (*MsgboxService) OnCreated

func (mbs *MsgboxService) OnCreated()

OnCreated is called when MsgboxService is created

func (*MsgboxService) OnInit

func (mbs *MsgboxService) OnInit()

OnInit initialize MsgboxService fields

func (*MsgboxService) Recv

func (mbs *MsgboxService) Recv(targetID common.EntityID, beginMsgId int64)

func (*MsgboxService) Send

func (mbs *MsgboxService) Send(targetID common.EntityID, msg Msg)

Send requests MsgboxService to send a message to target entity

Jump to

Keyboard shortcuts

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