summaryrefslogtreecommitdiff
path: root/src/piece.h
blob: 1c3e820fff86ffa7d5cb8c932bbe675bbd6717bc (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
#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 restartTo(PieceType type, int xpos);
        void rotate();
        void advance();
        void move_left();
        void move_right();

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

#endif