#ifndef __MONKEYCAR_AREA__ #define __MONKEYCAR_AREA__ //#include "monkeycar_person.h" //#include "monkeycar_bus.h" #include #include #include "area.h" #include "fp_path.h" struct db_area { std::vector m_point; double m_default_speed; }; struct monkey_bus; struct monkey_person; struct monkey_area : area,std::enable_shared_from_this { public: monkey_area(std::shared_ptr dap,int area_id,int over_count_person,int over_time_person,double scale,int32_t ,int32_t); ~monkey_area() {} std::shared_ptr find(uint32_t cardid); virtual void on_hover(const std::shared_ptr&a,const std::shared_ptr&c); virtual void on_enter(const std::shared_ptr&a,const std::shared_ptr&c); virtual void on_leave(const std::shared_ptr&a,const std::shared_ptr&c); void on_card_leave(uint32_t cardid); void on_card_enter(const std::shared_ptr&); void on_card_move(uint32_t cardid,const st_coord & st,uint64_t); inline double map(double x, double y) { return m_path.map(x,y); } inline point_2 map(double d) { return m_path.map(d); } inline double get_total_length() { return m_path.get_total_length(); } double getScale() { return scale(); } static uint64_t m_startTime; private: std::map> card_map_; std::vector> bus_; fp_path m_path; std::mutex m_mtx; }; #endif