source: trunk/monsterz/piece.h @ 350

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

Create the WorldEntity class, for objects with world coordinates.

File size: 1.1 KB
Line 
1//
2// Monsterz
3//
4// Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11//
12// The Piece class
13// ---------------
14//
15
16#if !defined __MONSTERZ_PIECE_H__
17#define __MONSTERZ_PIECE_H__
18
19#include "core.h"
20
21class PieceData;
22
23class Piece : public WorldEntity
24{
25public:
26    Piece(Emitter *emitter, int2 cell, int id);
27    virtual ~Piece();
28
29    void SetCell(int2 cell);
30    int2 GetCell() const;
31    void SetPos(int2 pos);
32    int2 GetPos() const;
33
34    void SetAbove(Piece *below);
35    Piece *GetAbove() const;
36    void SetBelow(Piece *below);
37    Piece *GetBelow() const;
38
39    int IsDead() const;
40
41    int Blink();
42    int Pop();
43    int Grab(int2 dir);
44    int Ungrab(int2 pos);
45    int Move(int2 pos);
46
47protected:
48    virtual void TickGame(float deltams);
49    virtual void TickDraw(float deltams);
50
51private:
52    PieceData *data;
53};
54
55#endif // __MONSTERZ_PIECE_H__
56
Note: See TracBrowser for help on using the repository browser.