summaryrefslogtreecommitdiff
path: root/src/piece.h
blob: 01a9ac89e0078921618f1dbbed0f3ee2a6e6beca (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
#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 = 0,
            BLOCK,
            S,
            T,
            L
        };

        Piece(int xpos);
        Piece(PieceType type, int xpos);
 
        Point getPosition();
        void restartTo(PieceType type, int xpos);
        void rotate();
        void advance();
        void move_left();
        void move_right();

        void initIterator();
        Point* nextAbsBlockPos();
};

#endif