Last change
on this file since 900 was
863,
checked in by sam, 10 years ago
|
core: rename vec2i to ivec2 etc. to better match GLSL.
|
File size:
1.3 KB
|
Rev | Line | |
---|
[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 | |
---|
| 21 | class PieceData; |
---|
| 22 | |
---|
[312] | 23 | class Piece : public WorldEntity |
---|
[226] | 24 | { |
---|
| 25 | public: |
---|
[384] | 26 | typedef enum |
---|
| 27 | { |
---|
| 28 | PIECE_HUNT, |
---|
| 29 | } |
---|
| 30 | piece_t; |
---|
| 31 | |
---|
[863] | 32 | Piece(piece_t, Emitter *emitter, ivec2 cell, int id); |
---|
[226] | 33 | virtual ~Piece(); |
---|
| 34 | |
---|
[419] | 35 | virtual char const *GetName(); |
---|
| 36 | |
---|
[863] | 37 | void SetCell(ivec2 cell); |
---|
| 38 | ivec2 GetCell() const; |
---|
| 39 | void SetPos(ivec2 pos); |
---|
| 40 | ivec2 GetPos() const; |
---|
[245] | 41 | |
---|
[863] | 42 | ivec2 GetOffset() const; |
---|
| 43 | ivec2 GetSize() const; |
---|
| 44 | ivec2 GetShift() const; |
---|
[384] | 45 | |
---|
[274] | 46 | void SetAbove(Piece *below); |
---|
| 47 | Piece *GetAbove() const; |
---|
| 48 | void SetBelow(Piece *below); |
---|
| 49 | Piece *GetBelow() const; |
---|
| 50 | |
---|
[266] | 51 | int IsDead() const; |
---|
| 52 | |
---|
[258] | 53 | int Pop(); |
---|
[863] | 54 | int Grab(ivec2 dir); |
---|
| 55 | int Ungrab(ivec2 pos); |
---|
| 56 | int Move(ivec2 pos); |
---|
[230] | 57 | |
---|
[226] | 58 | protected: |
---|
| 59 | virtual void TickGame(float deltams); |
---|
| 60 | virtual void TickDraw(float deltams); |
---|
| 61 | |
---|
| 62 | private: |
---|
| 63 | PieceData *data; |
---|
| 64 | }; |
---|
| 65 | |
---|
[312] | 66 | #endif // __MONSTERZ_PIECE_H__ |
---|
[226] | 67 | |
---|
Note: See
TracBrowser
for help on using the repository browser.