blob: 5e01b0dc5a1e012180ec313a952be6ad839bc3fe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef GAME_HPP
# define GAME_HPP
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <vector>
#include <utility>
#include "2048.hpp"
class Game
{
public:
Game(int size);
Game(Game const &other);
Game &operator=(Game const &other);
~Game();
int getSize() const;
int getScore() const;
int get(int y, int x) const;
bool move(Direction direction);
void spawn();
bool lost() const;
private:
int m_size;
int m_score;
int **m_grid;
void mergeRow(std::vector<int> &row);
};
bool operator==(Game const &a, Game const &b);
bool operator!=(Game const &a, Game const &b);
std::ostream &operator<<(std::ostream &out, Game const &game);
#endif
|