summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/Character.hpp12
-rw-r--r--inc/Frame.hpp4
-rw-r--r--inc/List.hpp7
-rw-r--r--inc/Location.hpp11
-rw-r--r--inc/main.hpp1
5 files changed, 29 insertions, 6 deletions
diff --git a/inc/Character.hpp b/inc/Character.hpp
index f2753a9..1f948f2 100644
--- a/inc/Character.hpp
+++ b/inc/Character.hpp
@@ -2,18 +2,28 @@
#define character_h
#include <ncurses.h>
+#include <cstdlib>
+#include <vector>
+#include <string>
+#include "Location.hpp"
+using namespace std;
class Character
{
public:
Character(char nSymbol, int nColor,int nRow, int nCol);
- void move(int nRow, int nCol);
+ void move(Location L);
void draw(WINDOW * w);
+ bool action(vector <Location> occupied);
+ bool check(Location L, vector <Location> occupied);
int getRow();
int getCol();
+ Location getLocation(){return l;}
char getSymbol();
private:
+ string order = "wander";
+ Location l;
char symbol;
int row;
int col;
diff --git a/inc/Frame.hpp b/inc/Frame.hpp
index 1cdf063..89242ff 100644
--- a/inc/Frame.hpp
+++ b/inc/Frame.hpp
@@ -26,8 +26,8 @@ class Frame
void fillWindow();
void refresh();
void move(int nRow, int nCol);
- void add(Character &c);
- void add(Character &c, int nRow, int nCol);
+ //void add(Character &c);
+ //void add(Character &c, int nRow, int nCol);
void erase(Character &c);
void center(Character &ch);
diff --git a/inc/List.hpp b/inc/List.hpp
index e997391..931ff8a 100644
--- a/inc/List.hpp
+++ b/inc/List.hpp
@@ -6,7 +6,7 @@
#include <ncurses.h>
#include <ctime>
#include <cstdlib>
-
+#include "Location.hpp"
using namespace std;
class List
@@ -14,9 +14,10 @@ class List
public:
List();
void draw(WINDOW * w);
- void actions();
+ void action();
private:
- vector <Character> men;
+ vector <Character> men;
+ vector <Location> occupied;
};
#endif
diff --git a/inc/Location.hpp b/inc/Location.hpp
new file mode 100644
index 0000000..458e77e
--- /dev/null
+++ b/inc/Location.hpp
@@ -0,0 +1,11 @@
+#ifndef location_h
+#define location_h
+
+class Location
+{
+ public:
+ int x;
+ int y;
+};
+
+#endif
diff --git a/inc/main.hpp b/inc/main.hpp
index 441e0d2..86d786d 100644
--- a/inc/main.hpp
+++ b/inc/main.hpp
@@ -5,5 +5,6 @@
#include "Character.hpp"
#include "Frame.hpp"
#include "List.hpp"
+#include "Location.hpp"
#endif