1
0

area_business_post_area.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #include "area.h"
  2. #include "card_base.h"
  3. #include "tool_time.h"
  4. #include "area_business_post_area.h"
  5. /*
  6. 确定推送人员信息时的区域,每一个明确需要推送的区域,都要推送
  7. */
  8. //将推送区域信息加入人员数据
  9. void area_business_post_area::on_load_his(const std::shared_ptr<area_hover>&a,const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr)
  10. {
  11. on_enter(a,c,ptr);
  12. }
  13. void area_business_post_area::on_enter(const std::shared_ptr<area_hover>&a,
  14. const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data>&ptr)
  15. {
  16. log_info("post_area: type:0, cardid:%d, area_id:%d, scale:%.2f", c->m_id, a->id(), a->scale());
  17. c->set_area_info(a->mapid(),a->scale(),a->id(),a->m_enter_time,0);
  18. }
  19. void area_business_post_area::on_hover(const std::shared_ptr<area_hover>&a,
  20. const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
  21. {
  22. log_info("post_area: type:1, cardid:%d, area_id:%d, scale:%.2f", c->m_id, a->id(), a->scale());
  23. c->set_area_info(a->mapid(),a->scale(),a->id(),a->m_enter_time,1);
  24. }
  25. //从人员数据中清除区域信息
  26. void area_business_post_area::on_leave(const std::shared_ptr<area_hover>&a,
  27. const std::shared_ptr<card_location_base>&c,std::shared_ptr<business_data> ptr)
  28. {
  29. log_info("post_area: type:2, cardid:%d, area_id:%d, scale:%.2f", c->m_id, a->id(), a->scale());
  30. c->set_area_info(0,0,a->id(),0,2);
  31. }