card_car.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef _card_car_h_
  2. #define _card_car_h_
  3. #include <string>
  4. #include <memory>
  5. #include "point.h"
  6. #include "card_base.h"
  7. #include "card_area.h"
  8. struct area_hover;
  9. struct mine_tool;
  10. struct site;
  11. struct site_area_hover;
  12. struct loc_point;
  13. struct car:card_location_base,card_area
  14. {
  15. int m_vehicle_category_id = 0;
  16. int m_vehicle_type_id = 0;
  17. boost::circular_buffer<double> m_speeds;
  18. public:
  19. car(const std::string&type,uint32_t cardid,uint16_t needdisplay,int16_t t,int32_t deptid,
  20. int32_t categoryid, int type_id,int32_t level_id,uint32_t cid);
  21. ~car();
  22. virtual std::shared_ptr<mine_tool> get_mine_tool();
  23. virtual void do_business(const std::shared_ptr<site>&site,const point &pt,double acc);
  24. virtual int get_area();
  25. int get_vehicle_type_id();
  26. virtual std::shared_ptr<area_tool> get_area_tool()
  27. {
  28. return m_area_tool;
  29. }
  30. virtual int get_vehicle_category_id()
  31. {
  32. return m_vehicle_category_id;
  33. }
  34. virtual void set_area_info(int mapid,double scale,int areaid,uint64_t t,int type);
  35. virtual void get_card(bool);
  36. private:
  37. void handle_three_rates(const point &pt);
  38. void handle_traffic_light(const point& pt, const int& sid);
  39. void handle_anti_coll(const point& pt, const int& sid);
  40. void handle_over_speed();
  41. void on_timer();
  42. void make_package();
  43. loc_point getSmoothPoint();
  44. };
  45. #endif