summaryrefslogtreecommitdiffstats
path: root/klickety/board.h
blob: f67e49265f4189e96e99eb6c0c9a3faef49c2c91 (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
37
38
39
#ifndef KL_BOARD_H
#define KL_BOARD_H

#include "base/board.h"
#include "base/piece.h"

class KLBoard : public BaseBoard
{
 Q_OBJECT
  TQ_OBJECT
 public:
	KLBoard(TQWidget *tqparent);

    void start(const GTInitData &data);

 signals:
    void firstBlockClicked();

 private:
    KGrid2D::Square<int> field;
    bool                sliding;
    TQMemArray<bool>     empty;
    uint                addRemoved;
    bool                blocked;

    KGrid2D::Coord findSprite(TQCanvasSprite *) const;
    AfterRemoveResult afterRemove(bool doAll, bool first);
    bool afterAfterRemove();
    bool toBeRemoved(const KGrid2D::Coord &) const;
    void remove();
    bool toFall(const KGrid2D::Coord &) const;
    bool toSlide(const KGrid2D::Coord &) const;
    bool doSlide(bool doAll, bool first, bool lineByLine);
    void computeInfos();

    void contentsMouseReleaseEvent(TQMouseEvent *);
};

#endif