diff options
author | tom <tom@ground-control> | 2015-11-23 17:05:27 -0600 |
---|---|---|
committer | tom <tom@ground-control> | 2015-11-23 17:05:27 -0600 |
commit | 9d9c1d29dbcd802c89641b70b5574361e775c0e4 (patch) | |
tree | bd66508d2db620db21db51c15276055d492297ea /inc | |
parent | 8228cd7ef6156d87ccf33335466c86fa30dadd8b (diff) |
added collision of trees and map border
Diffstat (limited to 'inc')
-rw-r--r-- | inc/Character.hpp | 4 | ||||
-rw-r--r-- | inc/Frame.hpp | 4 | ||||
-rw-r--r-- | inc/List.hpp | 5 | ||||
-rw-r--r-- | inc/Location.hpp | 1 |
4 files changed, 9 insertions, 5 deletions
diff --git a/inc/Character.hpp b/inc/Character.hpp index 1a7dcdd..a1fc7b7 100644 --- a/inc/Character.hpp +++ b/inc/Character.hpp @@ -14,8 +14,8 @@ class Character Character(char nSymbol, int nColor, Location L); void move(Location L){l=L;} void draw(WINDOW * w); - void action(vector <Character> men); - bool check(Location L, vector <Character> men); + void action(vector <Character> men, vector <Location> impassable); + bool check(Location L, vector <Character> men, vector <Location> impassable); Location getLocation(){return l;} char getSymbol(){return symbol;} diff --git a/inc/Frame.hpp b/inc/Frame.hpp index 4e4b57f..26a7364 100644 --- a/inc/Frame.hpp +++ b/inc/Frame.hpp @@ -27,15 +27,17 @@ class Frame void refresh(); void move(int nRow, int nCol); void center(Character &ch); + vector <Location> getImpassable(){return impassable;} private: int height, width; int row, col; bool hasSuper; - bool colored = false; + bool filled; WINDOW * w; WINDOW * super; vector <string> m; + vector <Location> impassable; }; #endif diff --git a/inc/List.hpp b/inc/List.hpp index ce3f413..447903b 100644 --- a/inc/List.hpp +++ b/inc/List.hpp @@ -11,11 +11,12 @@ using namespace std; class List { public: - List(); + List(vector <Location> i); void draw(WINDOW * w); void action(); private: - vector <Character> men; + vector <Character> men; + vector <Location> impassable; }; #endif diff --git a/inc/Location.hpp b/inc/Location.hpp index 5c6f1ea..ed0e2db 100644 --- a/inc/Location.hpp +++ b/inc/Location.hpp @@ -5,6 +5,7 @@ class Location { public: Location(){x=0;y=0;} + Location(int xn, int yn){x=xn;y=yn;} int x; int y; }; |