44 VIPRA_MODULE_NAME(
"DXF");
45 VIPRA_MODULE_TYPE(MapInput);
47 VIPRA_REGISTER_PARAMS()
49 void load(std::string
const& filepath)
override;
52 [[nodiscard]]
auto serialize() -> std::string
override {
return ""; }
53 void parse(std::string
const& )
override {}
56 -> std::optional<std::vector<VIPRA::Geometry::Polygon>>
override;
58 -> std::optional<std::vector<VIPRA::Geometry::Polygon>>
override;
61 std::map<std::string, std::vector<VIPRA::Geometry::Polygon>>>
override;
63 -> std::optional<std::map<std::string, VIPRA::Geometry::Polygon>>
override;
65 [[nodiscard]]
auto get_objective_types(std::vector<std::string>
const& keys)
const
66 -> std::optional<std::vector<std::string>>
68 if ( keys.size() != 1 )
return std::nullopt;
69 if ( keys[0] !=
"obj_types" )
return std::nullopt;
71 std::vector<std::string> types;
72 types.reserve(_objectives.size());
74 for (
auto const& [type, coords] : _objectives ) {
75 types.push_back(type);
81 [[nodiscard]]
static auto get_polygons(
82 std::vector<std::shared_ptr<DRW_Vertex>>& vertexList)
83 -> std::optional<std::vector<VIPRA::Geometry::Polygon>>;
86 std::filesystem::path _filepath;
88 std::map<std::string, std::vector<VIPRA::Geometry::Polygon>> _objectives;
89 std::vector<VIPRA::Geometry::Polygon> _obstacles;
90 std::vector<VIPRA::Geometry::Polygon> _spawns;
92 std::map<std::string, VIPRA::Geometry::Polygon> _areas;
auto get_objectives() const -> std::optional< std::map< std::string, std::vector< VIPRA::Geometry::Polygon > > > override
Returns Objectives map from the .dxf file.
Definition dxf.cpp:36
auto get_areas() const -> std::optional< std::map< std::string, VIPRA::Geometry::Polygon > > override
Returns spawn area geometry from the .dxf file.
Definition dxf.cpp:47