use super::block; impl State { fn cur_block(&self) -> &block::Block { self.blocks.last().unwrap() } fn cur_block_mut(&mut self) -> &mut block::Block { self.blocks.last_mut().unwrap() } } impl Default for State { #[inline] fn default() -> Self { Self{blocks: vec![block::Block::default()], tool: Tool::default()} } } impl Default for Tool { #[inline] fn default() -> Self {Tool::Points} } /// The state of an opened map editor. pub struct State { pub(super) blocks: Vec, pub(super) tool: Tool, } /// A tool in the map editor. #[derive(Debug)] pub(super) enum Tool { Points, Lines, Polygons, } // EOF