source: trunk/monsterz/piece.h @ 419

Last change on this file since 419 was 419, checked in by sam, 9 years ago

Name tilers, samples and pieces for easier debugging.

File size: 1.3 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    typedef enum
27    {
28        PIECE_HUNT,
29        PIECE_FUSION,
30    }
31    piece_t;
32
33    Piece(piece_t, Emitter *emitter, int2 cell, int id);
34    virtual ~Piece();
35
36    virtual char const *GetName();
37
38    void SetCell(int2 cell);
39    int2 GetCell() const;
40    void SetPos(int2 pos);
41    int2 GetPos() const;
42
43    int2 GetSize() const;
44    int2 GetShift() const;
45
46    void SetAbove(Piece *below);
47    Piece *GetAbove() const;
48    void SetBelow(Piece *below);
49    Piece *GetBelow() const;
50
51    int IsDead() const;
52
53    int Pop();
54    int Grab(int2 dir);
55    int Ungrab(int2 pos);
56    int Move(int2 pos);
57
58protected:
59    virtual void TickGame(float deltams);
60    virtual void TickDraw(float deltams);
61
62private:
63    PieceData *data;
64};
65
66#endif // __MONSTERZ_PIECE_H__
67
Note: See TracBrowser for help on using the repository browser.