-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtetris.h
More file actions
34 lines (28 loc) · 707 Bytes
/
tetris.h
File metadata and controls
34 lines (28 loc) · 707 Bytes
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
#ifndef __DIAMOND_H__
#define __DIAMOND_H__
#include"ctrl/ctrl.h"
#define MAX_SIZE 4
class Cube: public Ctrl {
protected:
int data[MAX_SIZE][MAX_SIZE];
int length;
public:
Cube(int length, Ctrl *parent=NULL);
void init();
void toShow(int focus);
void setShape(const int data[][MAX_SIZE]);
bool canMove(int xDlt, int yDlt);
int Up();
int Down();
int Left();
int Right();
int TimeEvent(int timestamp);
};
class Wall: public BackGround {
public:
Wall(int h, int w, bool fillSpace=false, Ctrl *parent=NULL): BackGround(h, w, fillSpace, parent){};
bool inRange(int x, int y);
bool addPix(int x, int y);
int erase();
};
#endif