diff options
author | tom <tom@ground-control> | 2015-11-22 19:41:09 -0600 |
---|---|---|
committer | tom <tom@ground-control> | 2015-11-22 19:41:09 -0600 |
commit | 84d63287c4d052052c9975714bbc253b18d28920 (patch) | |
tree | 5c11d0d8cbffc9d595133caf63878c3d7c3416f3 /src/Character.cpp | |
parent | 9f0de11816fdbd0981aeaa3a840e3942fd249eb4 (diff) |
removed occupied, just used men vector
Diffstat (limited to 'src/Character.cpp')
-rw-r--r-- | src/Character.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Character.cpp b/src/Character.cpp index 8b4a4b5..0ab594b 100644 --- a/src/Character.cpp +++ b/src/Character.cpp @@ -13,7 +13,7 @@ void Character::draw(WINDOW * w) mvwaddch(w,l.x,l.y,symbol); } -Location Character::action(vector <Location> occupied) +Location Character::action(vector <Character> men) { if(order == "wander") { @@ -64,7 +64,7 @@ Location Character::action(vector <Location> occupied) Lo = l; } - if(check(Lo,occupied)) + if(check(Lo,men)) { move(Lo); return Lo; @@ -74,10 +74,10 @@ Location Character::action(vector <Location> occupied) } } -bool Character::check(Location L, vector <Location> occupied) +bool Character::check(Location L, vector <Character> men) { for(int i = 0; i < 10; i++) - if(L.x == occupied[i].x && L.y == occupied[i].y) + if(L.x == men[i].getLocation().x && L.y == men[i].getLocation().y) return false; return true; |