From a760b9339a98281a8a1072d03dbf41f08eb696a6 Mon Sep 17 00:00:00 2001 From: tom Date: Wed, 18 Nov 2015 19:59:47 -0600 Subject: shovelling --- inc/Character.hpp | 19 +++++++++++++++++++ inc/Frame.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ inc/Screen.hpp | 21 +++++++++++++++++++++ inc/main.hpp | 8 ++++++++ 4 files changed, 89 insertions(+) create mode 100644 inc/Character.hpp create mode 100644 inc/Frame.hpp create mode 100644 inc/Screen.hpp create mode 100644 inc/main.hpp (limited to 'inc') diff --git a/inc/Character.hpp b/inc/Character.hpp new file mode 100644 index 0000000..4e0869a --- /dev/null +++ b/inc/Character.hpp @@ -0,0 +1,19 @@ +#ifndef character_h +#define character_h + +class Character +{ + public: + Character(char nSymbol, int nRow, int nCol); + void move(int nRow, int nCol); + int getRow(); + int getCol(); + char getSymbol(); + + private: + char symbol; + int row; + int col; +}; + +#endif diff --git a/inc/Frame.hpp b/inc/Frame.hpp new file mode 100644 index 0000000..35ff0d6 --- /dev/null +++ b/inc/Frame.hpp @@ -0,0 +1,41 @@ +#ifndef frame_h +#define frame_h + +#include +#include "Character.hpp" +#include +#include + + +class Frame +{ + public: + //Frame(int rows, int cols, int nRow, int nCol); // main window test + Frame(string location, int nRow, int nCol); // main window with seeded map + Frame(Frame &super, int rows, int cols, int nRow, int nCol); // viewport + ~Frame(); + WINDOW * getWin(); + WINDOW * getSuper(); + bool getHasSuper(); + int getHeight(); + int getWidth(); + int getRow(); + int getCol(); + void fillWindow(); + void refresh(); + void move(int nRow, int nCol); + void add(Character &c); + void add(Character &c, int nRow, int nCol); + void erase(Character &c); + void center(Character &ch); + + private: + int height, width; + int row, col; + bool hasSuper; + WINDOW * w; + WINDOW * super; + string m; +}; + +#endif diff --git a/inc/Screen.hpp b/inc/Screen.hpp new file mode 100644 index 0000000..505f4e2 --- /dev/null +++ b/inc/Screen.hpp @@ -0,0 +1,21 @@ +#ifndef window_h +#define window_h + +#include +#include "ncurses.h" + +using namespace std; + +class Screen +{ + public: + Screen(); + ~Screen(); + void ping(string msg); + int getHeight(); + int getWidth(); + private: + int height, width; +}; + +#endif diff --git a/inc/main.hpp b/inc/main.hpp new file mode 100644 index 0000000..6d3cae3 --- /dev/null +++ b/inc/main.hpp @@ -0,0 +1,8 @@ +#ifndef main_h +#define main_h + +#include "Screen.hpp" +#include "Character.hpp" +#include "Frame.hpp" + +#endif -- cgit v1.2.3