-
Notifications
You must be signed in to change notification settings - Fork 0
/
CTile.h
46 lines (44 loc) · 1.5 KB
/
CTile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//----------------------------------------------------------------------------
#ifndef __CTILE_H__
#define __CTILE_H__
//----------------------------------------------------------------------------
#include <QDataStream>
#include <QList>
//----------------------------------------------------------------------------
class CTile {
private:
friend QDataStream& operator<<(QDataStream& out, const CTile& tile);
friend QDataStream& operator>>(QDataStream& in, CTile& tile);
public:
explicit CTile(int x, int y);
bool solidUp, solidRight, solidDown, solidLeft;
struct {
bool active;
QString groupName;
int count;
QList<int> positions;
} animated;
bool climbing;
bool breakable;
bool touchBonus, hitBonus;
bool dangerous;
int getX(void);
int getY(void);
int getRealX(void);
int getRealY(void);
void parseAnimated(QString str);
QString serializeAnimated(void);
QString getHash(void);
static QString getGroup(QString str);
static QString getElement(QString str, int n);
private:
int x, y;
int realX, realY;
QString hash;
};
//-----------------------------------------------------------------------------------------------
QDataStream& operator<<(QDataStream& out, const CTile& tile);
QDataStream& operator>>(QDataStream& in, CTile& tile);
//----------------------------------------------------------------------------
#endif //__CTILE_H__
//----------------------------------------------------------------------------