29 lines
562 B
Go
29 lines
562 B
Go
package model
|
||
|
||
import (
|
||
"rocommon"
|
||
)
|
||
|
||
var (
|
||
updateList []interface{}
|
||
|
||
RoomMgr *RoomManager = nil
|
||
)
|
||
|
||
type RoomUpdate struct {
|
||
rocommon.UpdateModule //eventqueue.go
|
||
}
|
||
|
||
// 定义初始化模块,比方说角色管理模块,任务模块等,然后通过update来处理定时器相关的处理
|
||
func (self *RoomUpdate) Init() {
|
||
RoomMgr = newRoomManager()
|
||
updateList = append(updateList, RoomMgr)
|
||
}
|
||
|
||
func (self *RoomUpdate) Update(ms uint64) {
|
||
//对管理器进行更新操作
|
||
for _, data := range updateList {
|
||
data.(rocommon.UpdateLogic).Update(ms)
|
||
}
|
||
}
|