summaryrefslogtreecommitdiff
path: root/src/piece.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/piece.h')
-rw-r--r--src/piece.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/piece.h b/src/piece.h
new file mode 100644
index 0000000..53bd112
--- /dev/null
+++ b/src/piece.h
@@ -0,0 +1,32 @@
+#ifndef PIECES_H
+#define PIECES_H
+
+#include "point.h"
+
+class Piece {
+ const static int SIZE = 4;
+ Point blocks [SIZE];
+ Point current_block_;
+ Point position_;
+ int iterator;
+
+ public:
+ enum class PieceType{
+ LINE,
+ BLOCK,
+ S,
+ T,
+ L
+ };
+
+ Piece(PieceType type, int xpos);
+
+ Point getPosition();
+ void rotate();
+ void advance();
+
+ void initIterator();
+ Point* nextAbsBlockPos();
+};
+
+#endif