-
Notifications
You must be signed in to change notification settings - Fork 0
/
piece.h
47 lines (40 loc) · 959 Bytes
/
piece.h
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
#ifndef PIECE_H
#define PIECE_H
class Point{
public:
int x,y;
Point(int a=0,int b=0): x(a),y(b) {};
inline int operator==(const Point &rhs)
{ return ((x == rhs.x) && (y == rhs.y))?(1):(0); }
};
class Piece{
private:
Point body[4];
int color;
int width;
int height;
int* skirt;
Piece* next;
void linkRotations();
int equals(Piece *p);
static Piece *pieces;
public:
Piece(char pointlist[9],int c);
Piece() {};
static Piece* getPieces();
int getWidth() {return width;}
int getHeight() {return height;}
int getSkirt(int i) {return skirt[i];}
int getColor() {return color;}
Point getBody(int i) {return body[i];}
Piece* getRotation() {return next;}
void draw(Point cur);
static void testDraw();
static int side;
static int space;
};
inline int ctoi(char c);
#endif
//Changes
//Point cur to Point loc in void draw
//Made all static members private. Affect functionality?