30struct FGE_API TileMap :
public std::enable_shared_from_this<TileMap>
36 using TileSetList = std::vector<std::shared_ptr<TileSet>>;
37 using TileLayerList = std::vector<std::shared_ptr<BaseLayer>>;
39 TileLayerList _layers;
40 TileSetList _tileSets;
41 std::vector<ObjectDataWeak> _generatedObjects;
45 [[nodiscard]] TileLayerList::value_type* findLayerName(std::string_view name);
46 [[nodiscard]] TileLayerList::value_type
const* findLayerName(std::string_view name)
const;
48 bool loadFromFile(std::filesystem::path
const& path);
49 void save(nlohmann::json& jsonObject)
const;
50 void load(nlohmann::json& jsonObject, std::filesystem::path
const& filePath);
51 void generateObjects(
fge::Scene& scene, fge::ObjectPlan basePlan = FGE_SCENE_PLAN_DEFAULT);
53 [[nodiscard]] ObjectDataShared retrieveGeneratedTilelayerObject(std::string_view layerName)
const;
55 inline static std::shared_ptr<TileMap> create() {
return std::shared_ptr<TileMap>(
new TileMap()); }