summaryrefslogtreecommitdiffstats
path: root/klickety/piece.h
blob: 6966ff8021d2d54a8672a7c350639cde85f08737 (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 TQString colorLabel(uint i) const;
    virtual TQColor defaultColor(uint i) const;

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

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

#endif