summaryrefslogtreecommitdiffstats
path: root/klickety/piece.h
blob: b7d192f06d68041ee1f126e14135e5f8436bb205 (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
40
41
42
#ifndef KL_PIECE_H
#define KL_PIECE_H

#include "base/piece.h"


class KLPieceInfo : public GPieceInfo
{
 public:
    KLPieceInfo() {}

    virtual uint nbBlocks() const             { return 0; }
    virtual uint nbTypes() const              { return NB_BLOCK_TYPES; }
    virtual uint nbForms() const              { return 0; }

    virtual const int *i(uint, uint) const    { return 0; }
    virtual const int *j(uint, uint) const    { return 0; }
    virtual uint value(uint, uint) const      { return 0; }
    virtual uint form(uint) const             { return 0; }
    virtual uint nbConfigurations(uint) const { return 0; }

    virtual uint nbNormalBlockTypes() const   { return NB_BLOCK_TYPES; }
    virtual uint nbGarbageBlockTypes() const  { return 0; }
    virtual uint nbBlockModes() const         { return 1+4+6+4+1; }

    virtual uint nbColors() const             { return NB_BLOCK_TYPES; }
    virtual QString colorLabel(uint i) const;
    virtual QColor defaultColor(uint i) const;

 protected:
    void draw(QPixmap *, uint blockType, uint blockMode,
              bool lighted) const;

 private:
    static const uint NB_BLOCK_TYPES = 5;
    static const char *DEFAULT_COLORS[NB_BLOCK_TYPES];
};

#endif