From 1e77601579065df48a9b1d9daa9dba46522842ca Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Mon, 23 Oct 2017 11:57:59 -0500 Subject: -decent starting point, but centering does not seem to be working --- src/list.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/list.rs (limited to 'src/list.rs') diff --git a/src/list.rs b/src/list.rs new file mode 100644 index 0000000..cdf00a8 --- /dev/null +++ b/src/list.rs @@ -0,0 +1,36 @@ +extern crate pancurses; + +use character::Character; +use location::Location; + +pub struct List{ + men : Vec, + impassable : Vec, +} + +impl List{ + pub fn new(impassable : Vec) -> List { + let mut men = Vec::new(); + for i in 0..3 { + let l = Location{x:150,y:150+i}; + let c = Character::new('@',4,l); + men.push(c); + } + List{ + men : men, + impassable : impassable, + } + } + + pub fn draw(&self, window : &pancurses::Window) { + for man in self.men.iter(){ + man.draw(window); + } + } + + pub fn action(&self) { + for man in self.men.iter(){ + man.action(self.men.to_vec(), self.impassable.to_vec()); + } + } +} -- cgit v1.2.3