source: trunk/monsterz/piece.h @ 303

Last change on this file since 303 was 303, checked in by sam, 10 years ago

Heavily optimise the crappy initial board generation.

File size: 856 bytes
Line 
1//
2// Deus Hax (working title)
3// Copyright (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
4//
5
6//
7// The Piece class
8// ---------------
9//
10
11#if !defined __DH_PIECE_H__
12#define __DH_PIECE_H__
13
14#include "core.h"
15
16class PieceData;
17
18class Piece : public Entity
19{
20public:
21    Piece(Emitter *emitter, int2 cell, int id);
22    virtual ~Piece();
23
24    void SetCell(int2 cell);
25    int2 GetCell() const;
26    void SetPos(int2 pos);
27    int2 GetPos() const;
28
29    void SetAbove(Piece *below);
30    Piece *GetAbove() const;
31    void SetBelow(Piece *below);
32    Piece *GetBelow() const;
33
34    int IsDead() const;
35
36    int Blink();
37    int Pop();
38    int Grab(int2 dir);
39    int Ungrab(int2 pos);
40    int Move(int2 pos);
41
42protected:
43    virtual void TickGame(float deltams);
44    virtual void TickDraw(float deltams);
45
46private:
47    PieceData *data;
48};
49
50#endif // __DH_PIECE_H__
51
Note: See TracBrowser for help on using the repository browser.