From fb0d1b3e66251aa56a3df1d05fd4b82b33380a31 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Sun, 25 Aug 2019 13:25:13 -0400 Subject: Wipe Rust project Sorry rust, but you're just not fun to write --- src/entities/environment.rs | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 src/entities/environment.rs (limited to 'src/entities/environment.rs') diff --git a/src/entities/environment.rs b/src/entities/environment.rs deleted file mode 100644 index 8f8a56706287..000000000000 --- a/src/entities/environment.rs +++ /dev/null @@ -1,36 +0,0 @@ -use crate::display; -use crate::display::draw_box::{BoxStyle, Stylable}; -use crate::entities::Entity; -use crate::types::{Neighbors, Position}; -use std::io::{self, Write}; - -entity! { - pub struct Wall { - pub style: BoxStyle - } -} - -static_description!(Wall, "a wall"); - -impl Wall { - pub fn new(position: Position, style: BoxStyle) -> Self { - new_entity!(Wall { position, style }) - } -} - -impl display::DrawWithNeighbors for Wall { - fn do_draw_with_neighbors<'a, 'b>( - &'a self, - out: &'b mut dyn Write, - neighbors: &'a Neighbors>>, - ) -> io::Result<()> { - let neighbor_styles: Neighbors> = - neighbors.map(|es| { - es.iter() - .filter_map(|e| e.downcast_ref::()) - .map(|wall| wall.style) - .next() - }); - write!(out, "{}", neighbor_styles.style(self.style)) - } -} -- cgit 1.4.1