#pragma once class TiledObject { public: a8::XValue GetProperty(const std::string& prop_name); bool HasProperty(const std::string& prop_name); public: std::map prop_hash; }; class TiledLayer { public: a8::XValue GetProperty(const std::string& prop_name); bool HasProperty(const std::string& prop_name); public: std::map prop_hash; a8::XValue data; }; //格子对象 struct GridCell { int x = 0; int y = 0; int speed = 0; int value = 0; }; struct StagePoint { int x = 0; int y = 0; std::string point; std::vector relation_list; }; struct TriggerPoint { int x = 0; int y = 0; std::string point; bool istrigger = false; }; class TiledMap { public: TiledLayer* ground_layer = nullptr; std::list speed_layers; int tile_count = 0; //瓦片地图的尺寸。(以瓦片数量为单位) int tile_width = 0; //瓦片的宽。(以像素点为单位) int tile_height = 0; //瓦片的高。(以像素点为单位) int tile_columns = 0; //列 bool LoadTmxFile(const std::string& filename); std::list* GetObjectGroup(const std::string& object_class_name); void Dump(); void Init(); private: std::map> layer_hash; std::map> object_group_hash; std::map stage_object_hash; //key point std::vector trigger_list; std::map> stage_path_hash; //key A->B AB std::vector grid_cell_list; //所有的格子数组 size = x * y std::map> grid_cell_hash; //key 11|2 坐标 };