//! 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::client::transform::Transform; use crate::world::Component; 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 this mappable as a world component. fn as_component(&self) -> &dyn Component; }