summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Barrett <tombarrett@siu.edu>2018-01-22 01:56:12 -0600
committerTom Barrett <tombarrett@siu.edu>2018-01-22 01:56:12 -0600
commitde7b818115cc98dbd22e29f2d244a2d2f1e36861 (patch)
treef9451d55b9f56fa5e39cc3cbc5a9cf70f1d8967c
parent86ddbbd163377bf8f50462e84d7dc6204c812367 (diff)
-maybe make men passable?HEADmaster
-rw-r--r--src/list.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/list.rs b/src/list.rs
index f9990b1..caf9bfb 100644
--- a/src/list.rs
+++ b/src/list.rs
@@ -20,7 +20,7 @@ impl List {
pub fn new(impassable_locations : Vec<Location>) -> List {
let mut men = Vec::new();
- for i in 0..10 {
+ for i in 0..100 {
men.push(Character::new('@', Colors::BlueUnit as u8, Location(150,150+i)));
}
List {
@@ -48,9 +48,9 @@ impl List {
if self.men[i].needs_path() {
let man = self.men[i].clone();
let impassable_clone = impassable.clone();
- self.threads.push(spawn(move || {
+ self.threads.push(spawn(move ||
(i, calculate_path(man, impassable_clone))
- }));
+ ));
}
}
}
@@ -106,11 +106,11 @@ impl List {
potential_locations.retain(|potential_location| {
let mut keep = true;
- for man in self.men.iter() {
+ /*for man in self.men.iter() {
if potential_location.0 == man.get_location() {
keep = false;
}
- }
+ }*/
for impassable_location in self.impassable_locations.iter() {
if potential_location.0 == *impassable_location {
keep = false;
@@ -124,9 +124,9 @@ impl List {
fn get_all_impassable(&mut self) -> Vec<(Location, usize)> {
let mut impassable = Vec::new();
- for man in self.men.iter() {
+ /*for man in self.men.iter() {
impassable.push((man.get_location(), 1));
- }
+ }*/
for impassable_location in self.impassable_locations.iter() {
impassable.push((*impassable_location,1));
}