summaryrefslogtreecommitdiff
path: root/src/list.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/list.rs')
-rw-r--r--src/list.rs36
1 files changed, 36 insertions, 0 deletions
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<Character>,
+ impassable : Vec<Location>,
+}
+
+impl List{
+ pub fn new(impassable : Vec<Location>) -> 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());
+ }
+ }
+}