From f92e9f6f07b1e3834c2ca58ce3510734819d08e4 Mon Sep 17 00:00:00 2001 From: Arne Dußin Date: Wed, 27 Jan 2021 14:01:50 +0100 Subject: Rework graf karto to fit the client/server structure --- src/map/mappable.rs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/map/mappable.rs (limited to 'src/map/mappable.rs') diff --git a/src/map/mappable.rs b/src/map/mappable.rs deleted file mode 100644 index 7978f50..0000000 --- a/src/map/mappable.rs +++ /dev/null @@ -1,35 +0,0 @@ -//! Something that's mappable can be placed on the map and drawn at a specific position. It has a -//! dimension on the map and may be transformable in various ways. - -use crate::math::Rect; -use crate::transform::Transform; -use crate::transformable::NonRigidTransformable; -use raylib::drawing::RaylibDrawHandle; - -/// Anything that can be added to the map or world must implement this trait. -pub trait Mappable { - /// Draw this to `rld` with the transform. An item that cannot be drawn is not mappable, so - /// this must always be implemented. - fn draw(&self, rld: &mut RaylibDrawHandle, transform: &Transform); - - /// Set the selection status of this item. If it is selected, actions that concern all selected - /// items will be applied to this item as well. - fn set_selected(&mut self, selected: bool); - - /// Get if this item is currently selected. - fn selected(&self) -> bool; - - /// Get the rectangle that contains the mappable object in its entirety without excess. - fn bounding_rect(&self) -> Rect; - - /// If this mappable item can be transformed in a non-rigid way, a dynamic reference is returned, - /// otherwise none. - fn as_non_rigid(&self) -> Option<&dyn NonRigidTransformable> { - None - } - - /// The same as `as_non_rigid`, but mutably. - fn as_non_rigid_mut(&mut self) -> Option<&mut dyn NonRigidTransformable> { - None - } -} -- cgit v1.2.3-70-g09d2