diff options
| author | Arne Dußin | 2021-01-11 12:10:16 +0100 |
|---|---|---|
| committer | Arne Dußin | 2021-01-11 12:10:16 +0100 |
| commit | ec071d5bc677101c0168b5fb3065f2d928234ed9 (patch) | |
| tree | 963ae90a6563c1f08d8e52078afd62db32e182f0 /src/map/data.rs | |
| parent | ad1e79a517ce64eda7b06bb1567d3df070813dca (diff) | |
| download | graf_karto-ec071d5bc677101c0168b5fb3065f2d928234ed9.tar.gz graf_karto-ec071d5bc677101c0168b5fb3065f2d928234ed9.zip | |
Rect rooms are now normal polygon rooms in data
Before there was an extra data type for rectangular rooms. This is now
changed, with the rectangle tool remaining, to create these often
required rooms faster, but the data type is just a normal polygon that
is generated from a rect to reduce redundancy.
Diffstat (limited to 'src/map/data.rs')
| -rw-r--r-- | src/map/data.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/map/data.rs b/src/map/data.rs index 0c11d1c..3258512 100644 --- a/src/map/data.rs +++ b/src/map/data.rs @@ -1,6 +1,6 @@ //! Module containing the raw map data version of the map. -use super::{IconData, Map, PolygonRoomData, RectRoomData, WallData}; +use super::{IconData, Map, PolygonRoomData, WallData}; use ron::de::from_reader; use ron::ser::{to_string_pretty, PrettyConfig}; use serde::{Deserialize, Serialize}; @@ -13,7 +13,6 @@ use std::path::Path; /// it easily corruptable. #[derive(Serialize, Deserialize)] pub struct MapData { - pub(super) rect_rooms: Vec<RectRoomData>, pub(super) polygon_rooms: Vec<PolygonRoomData>, pub(super) walls: Vec<WallData>, pub(super) icons: Vec<IconData>, @@ -22,13 +21,11 @@ pub struct MapData { impl MapData { /// Create a serialisable map data type from the data elements contained in a map. pub fn new( - rect_rooms: Vec<RectRoomData>, polygon_rooms: Vec<PolygonRoomData>, walls: Vec<WallData>, icons: Vec<IconData>, ) -> Self { Self { - rect_rooms, polygon_rooms, walls, icons, @@ -41,11 +38,6 @@ impl MapData { /// included. pub fn extract_data(map: &Map) -> Self { Self { - rect_rooms: map - .rect_rooms() - .iter() - .map(|r| *(r as &RectRoomData)) - .collect(), polygon_rooms: map .polygon_rooms() .iter() |
