From 9d9c1d29dbcd802c89641b70b5574361e775c0e4 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 23 Nov 2015 17:05:27 -0600 Subject: added collision of trees and map border --- inc/Character.hpp | 4 ++-- inc/Frame.hpp | 4 +++- inc/List.hpp | 5 +++-- inc/Location.hpp | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) (limited to 'inc') 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 men); - bool check(Location L, vector men); + void action(vector men, vector impassable); + bool check(Location L, vector men, vector 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 getImpassable(){return impassable;} private: int height, width; int row, col; bool hasSuper; - bool colored = false; + bool filled; WINDOW * w; WINDOW * super; vector m; + vector 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 i); void draw(WINDOW * w); void action(); private: - vector men; + vector men; + vector 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; }; -- cgit v1.2.3