aoi.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package mapCall
  2. import (
  3. capp "f1-game/internal/cherry_app"
  4. "f1-game/internal/enum"
  5. nameActor "f1-game/internal/name/actor"
  6. nameRemote "f1-game/internal/name/remote"
  7. mapTypes "f1-game/nodes/map/internal/types"
  8. cfacade "github.com/cherry-game/cherry/facade"
  9. )
  10. var (
  11. AOI = &aoiCall{
  12. aoiPath: cfacade.NewPath("", nameActor.Map_AOI),
  13. }
  14. )
  15. type aoiCall struct {
  16. aoiPath string
  17. }
  18. func (p *aoiCall) Enter(req *mapTypes.AOIRequest) {
  19. capp.Call(p.aoiPath, nameRemote.MapAOI_Enter, req)
  20. }
  21. func (p *aoiCall) Move(req *mapTypes.AOIRequest) {
  22. capp.Call(p.aoiPath, nameRemote.MapAOI_Move, req)
  23. }
  24. func (p *aoiCall) Leave(objectID int64, objectType enum.ObjectType) {
  25. capp.Call(p.aoiPath, nameRemote.MapAOI_Leave, objectID)
  26. }
  27. // AOI 全量更新
  28. func (p *aoiCall) UpdateAll(objectID int64, objectType enum.ObjectType) {
  29. req := mapTypes.NewUpdateAOIRequest(objectID, objectType, 0, nameRemote.MapLogic_AOIMarkerUpdate)
  30. capp.Call(p.aoiPath, nameRemote.MapAOI_Update, req)
  31. }
  32. // AOI 增量更新
  33. func (p *aoiCall) UpdateWithID(objectID int64, objectType enum.ObjectType, updateID uint32, funcName string) {
  34. req := mapTypes.NewUpdateAOIRequest(objectID, objectType, updateID, funcName)
  35. capp.Call(p.aoiPath, nameRemote.MapAOI_Update, req)
  36. }