/
avatar_option.go
35 lines (28 loc) · 1.23 KB
/
avatar_option.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package lox
import (
"github.com/nomos/go-lokas"
"github.com/nomos/go-lokas/protocol"
"github.com/nomos/go-lokas/util"
)
type GameHandler struct {
Serializer func(avatar lokas.IActor, process lokas.IProcess) error
Initializer func(avatar lokas.IActor, process lokas.IProcess) error
Deserializer func(avatar lokas.IActor, process lokas.IProcess) error
Updater func(avatar lokas.IActor, process lokas.IProcess) error
MsgDelegator func(avatar lokas.IActor, actorId util.ID, transId uint32, msg protocol.ISerializable) (protocol.ISerializable, error)
}
func (this *GameHandler) GetSerializer() func(avatar lokas.IActor, process lokas.IProcess) error {
return this.Serializer
}
func (this *GameHandler) GetInitializer() func(avatar lokas.IActor, process lokas.IProcess) error {
return this.Initializer
}
func (this *GameHandler) GetDeserializer() func(avatar lokas.IActor, process lokas.IProcess) error {
return this.Deserializer
}
func (this *GameHandler) GetUpdater() func(avatar lokas.IActor, process lokas.IProcess) error {
return this.Updater
}
func (this *GameHandler) GetMsgDelegator() func(avatar lokas.IActor, actorId util.ID, transId uint32, msg protocol.ISerializable) (protocol.ISerializable, error) {
return this.MsgDelegator
}