diff options
Diffstat (limited to 'src/map/rect_room.rs')
| -rw-r--r-- | src/map/rect_room.rs | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/map/rect_room.rs b/src/map/rect_room.rs index 5008c63..6ed3ed6 100644 --- a/src/map/rect_room.rs +++ b/src/map/rect_room.rs @@ -1,14 +1,17 @@ +//! Deprecated simple rectangular room type. + use crate::colours::DEFAULT_COLOURS; use crate::map::Mappable; -use crate::math::{Rect, Vec2}; -use crate::scaleable::Scaleable; +use crate::math::Rect; use crate::transform::Transform; use raylib::drawing::{RaylibDraw, RaylibDrawHandle}; use serde::Serialize; use std::ops::{Deref, DerefMut}; +#[allow(missing_docs)] pub type RectRoomData = Rect<f64>; +#[allow(missing_docs)] #[derive(Serialize)] pub struct RectRoom { data: RectRoomData, @@ -16,6 +19,7 @@ pub struct RectRoom { } impl RectRoom { + #[allow(missing_docs)] pub fn from_data(data: RectRoomData) -> Self { RectRoom { data, @@ -47,21 +51,6 @@ impl Mappable for RectRoom { fn bounding_rect(&self) -> Rect<f64> { self.data.clone() } - - fn as_scaleable(&self) -> Option<&dyn Scaleable> { - Some(self as &dyn Scaleable) - } -} - -impl Scaleable for RectRoom { - fn scale(&mut self, by: &Vec2<f64>) { - if by.x < 0. || by.y < 0. { - panic!("Cannot set dimensions with negative size"); - } - - self.data.x *= by.x; - self.data.y *= by.y; - } } impl Deref for RectRoom { |
