#pragma once #include #include "model/Texture.h" #include "utilities/utilities.h" #include "utilities/parser.h" #include "textures_scanner.h" struct dynamic_desc { std::string name; std::string drivertype = "nobody"; float offset; std::string loadtype = "none"; int loadcount; unsigned int coupling; std::string params; std::shared_ptr vehicle; std::shared_ptr skin; }; struct trainset_desc { std::pair file_bounds; std::string description; std::string name; std::string track; float offset { 0.f }; float velocity { 0.f }; std::vector vehicles; }; struct scenery_desc { std::filesystem::path path; std::string name; std::string description; std::string category; std::string image_path; texture_handle image = 0; std::vector> links; std::vector trainsets; std::string title() { if (!name.empty()) return name; else return path.stem().string(); } }; class scenery_scanner { public: scenery_scanner(ui::vehicles_bank &bank); std::vector scenarios; std::map> categories; void scan(); private: void scan_scn(std::filesystem::path path); void parse_trainset(cParser &parser); void build_categories(); ui::vehicles_bank &bank; };