source: trunk/monsterz/piece.h @ 294

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

Rename Float3 to float3, Int3 to int3 etc. and add the 4-member versions.

File size: 893 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 "entity.h"
15#include "game.h"
16
17class PieceData;
18
19class Piece : public Entity
20{
21public:
22    Piece(Game *game, int2 cell, int id);
23    virtual ~Piece();
24
25    void SetCell(int2 cell);
26    int2 GetCell() const;
27    void SetPos(int2 pos);
28    int2 GetPos() const;
29    int GetId() const;
30
31    void SetAbove(Piece *below);
32    Piece *GetAbove() const;
33    void SetBelow(Piece *below);
34    Piece *GetBelow() const;
35
36    int IsDead() const;
37
38    int Blink();
39    int Pop();
40    int Grab(int2 dir);
41    int Ungrab(int2 pos);
42    int Move(int2 pos);
43
44protected:
45    virtual void TickGame(float deltams);
46    virtual void TickDraw(float deltams);
47
48private:
49    PieceData *data;
50};
51
52#endif // __DH_PIECE_H__
53
Note: See TracBrowser for help on using the repository browser.