Game2048.h 681 Bytes
Newer Older
1 2 3
#include <iostream>
#include <vector>
#include "Movement.h"
Brandon Toledo's avatar
Brandon Toledo committed
4
#include "Display.h"
5 6 7 8 9

using namespace std;

class Game2048 {
    public:
Brandon Toledo's avatar
Brandon Toledo committed
10
        Game2048(int gameSize, int& highScore); // remove the pass by reference in high score
11
        void playGame();
Brandon Toledo's avatar
Brandon Toledo committed
12 13
        void Draw() {display.showGame(*board, score, highScore);}
        void Shift(char input);
Brandon Toledo's avatar
Brandon Toledo committed
14
        void testInit(){*board = { {4,0,0,2}, {4,2,0,0}, {4,4,0,0}, {4,4,0,0}};}
Brandon Toledo's avatar
Brandon Toledo committed
15
        bool addNumber();
16
        int getScore() {return score;}
Brandon Toledo's avatar
Brandon Toledo committed
17 18

    
19 20

    private:
21
        int highScore;
22 23
        int gameSize;
        int score;
Brandon Toledo's avatar
Brandon Toledo committed
24 25 26
        Movement movement;
        Display display;
        vector<vector<int>>* board = nullptr;
27
};