-
Notifications
You must be signed in to change notification settings - Fork 0
/
Piece.hpp
62 lines (51 loc) · 1.21 KB
/
Piece.hpp
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// Piece.hpp for Tetris in /home/wilmot_p/PROJETS/Tetris
//
// Made by Pierre WILMOT
// Login <[email protected]>
//
// Started on Thu Jul 26 23:54:08 2012 Pierre WILMOT
// Last update Tue Aug 7 06:32:32 2012 Pierre WILMOT
//
#ifndef __PIECE_HPP__
#define __PIECE_HPP__
#include <iostream>
#include "IView.hpp"
#include "Colors.hpp"
#define MAX_HEIGT 5
#define MAX_WIDTH 5
class Piece
{
public:
Piece();
~Piece();
int getX() const;
int getY() const;
unsigned int getMaxX() const;
unsigned int getMaxY() const;
unsigned int getMinX() const;
unsigned int getMinY() const;
void setX(unsigned int x);
void setY(unsigned int y);
bool getBloc(int x, int y) const;
void setBloc(int x, int y, bool v);
Colors::e_color getColor() const;
void setColor(Colors::e_color);
void reset();
void display(IView &v, unsigned int yLimit) const;
void rotate();
void calcMaximuns();
Piece &operator=(const Piece &m);
private:
int m_x;
int m_y;
unsigned int m_minX;
unsigned int m_minY;
unsigned int m_maxX;
unsigned int m_maxY;
bool **m_shape;
Colors::e_color m_color;
std::string m_pieces[7];
Colors::e_color m_colordList[7];
};
#endif