aoi_model.go 570 B

12345678910111213141516171819202122232425262728
  1. package model
  2. import (
  3. "rocommon"
  4. )
  5. var (
  6. updateList []interface{}
  7. RoleMapMag *RoleMapManager
  8. )
  9. type AoiUpdate struct {
  10. rocommon.UpdateModule //eventqueue.go
  11. }
  12. //定义初始化模块,比方说角色管理模块,任务模块等,然后通过update来处理定时器相关的处理
  13. func (this *AoiUpdate) Init() {
  14. RoleMapMag = newAoiRoleMapManager()
  15. updateList = append(updateList, RoleMapMag)
  16. }
  17. func (this *AoiUpdate) Update(ms uint64) {
  18. //对管理器进行更新操作
  19. for _, data := range updateList {
  20. data.(rocommon.UpdateLogic).Update(ms)
  21. }
  22. }