From 4cc6c6596b614fce392040b85a182dbf50d0b044 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sun, 3 May 2015 09:57:31 +0200 Subject: Organize all the code --- src/Model/Grid.hpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/Model/Grid.hpp') diff --git a/src/Model/Grid.hpp b/src/Model/Grid.hpp index 4ed5c10..51168a9 100644 --- a/src/Model/Grid.hpp +++ b/src/Model/Grid.hpp @@ -15,45 +15,45 @@ class Grid { private: + //Members int m_size; std::vector > m_grid; - int m_lastMoveScore; + //Private methods int maxStrLenInGrid(); public: + //Constructor and Destructor Grid(); ~Grid(); - std::string description(); - bool isEmpty(int i, int j); - std::tuple getRandomEmptyCellCoord(); - - bool setCell(std::tuple coord, int value); - bool setCell(int i, int j, int value); - - std::vector swipeLine(std::vector line); + //Defragment and merge methods std::vector rightDefragment(std::vector line); std::vector leftDefragment(std::vector line); std::vector rightMerge(std::vector line); std::vector leftMerge(std::vector line); - std::vector getCol(int col); - - bool isFull(); - bool isOver(); - - void setCol(int col, std::vector colVect); - std::vector reverseLine(std::vector line); - bool compareLines(std::vector line1, std::vector line2); - - //Moves + //Swipe methods bool swipeRight(); bool swipeLeft(); bool swipeUp(); bool swipeDown(); + //Helpers + bool isFull(); + bool isOver(); + bool isEmpty(int i, int j); + std::tuple getRandomEmptyCellCoord(); + bool compareLines(std::vector line1, std::vector line2); + std::vector reverseLine(std::vector line); + std::string description(); + + //Getters and Setters + bool setCell(std::tuple coord, int value); + bool setCell(int i, int j, int value); + std::vector getCol(int col); + void setCol(int col, std::vector colVect); int getLastMoveScore(); }; -- cgit v1.2.3