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
RevLine 
[226]1//
[312]2// Monsterz
[226]3//
[312]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//
[226]10
11//
12// The Piece class
13// ---------------
14//
15
[312]16#if !defined __MONSTERZ_PIECE_H__
17#define __MONSTERZ_PIECE_H__
[226]18
[297]19#include "core.h"
[226]20
21class PieceData;
22
[312]23class Piece : public WorldEntity
[226]24{
25public:
[297]26    Piece(Emitter *emitter, int2 cell, int id);
[226]27    virtual ~Piece();
28
[294]29    void SetCell(int2 cell);
30    int2 GetCell() const;
31    void SetPos(int2 pos);
32    int2 GetPos() const;
[245]33
[274]34    void SetAbove(Piece *below);
35    Piece *GetAbove() const;
36    void SetBelow(Piece *below);
37    Piece *GetBelow() const;
38
[266]39    int IsDead() const;
40
[238]41    int Blink();
[258]42    int Pop();
[294]43    int Grab(int2 dir);
44    int Ungrab(int2 pos);
45    int Move(int2 pos);
[230]46
[226]47protected:
48    virtual void TickGame(float deltams);
49    virtual void TickDraw(float deltams);
50
51private:
52    PieceData *data;
53};
54
[312]55#endif // __MONSTERZ_PIECE_H__
[226]56
Note: See TracBrowser for help on using the repository browser.