添加waypoing dat

This commit is contained in:
aozhiwei 2019-06-01 17:40:13 +08:00
parent 366eeab683
commit c8007e81dd
2 changed files with 95 additions and 85 deletions

View File

@ -30,7 +30,7 @@ namespace f8
return itr != prop_hash.end(); return itr != prop_hash.end();
} }
bool TiledMap::LoadTmxFile(const std::string& filename) bool TiledMap::LoadTmxFile(const std::string& filename, bool new_tmx_format)
{ {
a8::XObject xobj; a8::XObject xobj;
if (!xobj.ReadFromXmlFile(filename)) { if (!xobj.ReadFromXmlFile(filename)) {
@ -462,4 +462,10 @@ void TiledMap::SetGridCellSpeedByAreaId(std::map<int,int>& area_speed_hash)
} }
} }
} }
void TiledMap::LoadWayPointsData()
{
}
} }

View File

@ -60,7 +60,7 @@ namespace f8
int tile_rows = 0; //行 int tile_rows = 0; //行
int tile_columns = 0; //列 int tile_columns = 0; //列
bool LoadTmxFile(const std::string& filename); bool LoadTmxFile(const std::string& filename, bool new_tmx_format = false);
std::list<TiledObject>* GetObjectGroup(const std::string& object_class_name); std::list<TiledObject>* GetObjectGroup(const std::string& object_class_name);
void Dump(); void Dump();
void Init(); void Init();
@ -76,6 +76,9 @@ namespace f8
//速度设置 //速度设置
void SetGridCellSpeedByAreaId(std::map<int,int>& area_speed_hash);//key:area_id value:speed void SetGridCellSpeedByAreaId(std::map<int,int>& area_speed_hash);//key:area_id value:speed
private:
void LoadWayPointsData();
private: private:
std::map<std::string, std::list<TiledLayer>> layer_hash; std::map<std::string, std::list<TiledLayer>> layer_hash;
std::map<std::string, std::list<TiledObject>> object_group_hash; std::map<std::string, std::list<TiledObject>> object_group_hash;
@ -86,5 +89,6 @@ namespace f8
std::vector<GridCell> grid_cell_list; //所有的格子数组 size = x * y std::vector<GridCell> grid_cell_list; //所有的格子数组 size = x * y
std::map<std::string, std::vector<GridCell>> grid_cell_hash; //key 11|2 坐标 std::map<std::string, std::vector<GridCell>> grid_cell_hash; //key 11|2 坐标
std::map<std::string, std::vector<std::tuple<int, int>>> waypoint_hash_; //路点数据
}; };
} }