-
Notifications
You must be signed in to change notification settings - Fork 1
/
tile.h
48 lines (39 loc) · 1.2 KB
/
tile.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
47
48
#ifndef __TILE_H__
#define __TILE_H__
#include <SFML/Network.hpp>
#include <deque>
#include "item.h"
#include "creature.h"
#include "enums.h"
typedef std::deque<Item*> ItemDeque;
typedef std::deque<Creature*> CreatureDeque;
class Tile : public Thing
{
public:
Tile(Position _tilePos){pos.x = _tilePos.x; pos.y = _tilePos.y; pos.z = _tilePos.z; ground = NULL; type = 0;};
Tile(int Px, int Py, unsigned char Pz) {pos.x = Px; pos.y = Py, pos.z = Pz; ground = NULL; type = 0;};
Tile() { ground = NULL; type = 0;};
unsigned int canAddThing();
void addThing(Thing *thing);
void transformThing(unsigned char stackpos, Thing *thing);
bool removeThing(unsigned char stackpos);
bool removeTopItem(unsigned short count = 1);
void removeCreatureByID(unsigned int id);
Thing* getThing(unsigned char stackpos);
bool hasContainer();
Item* getTopItem();
unsigned char getIndexOfThing(Thing* thing);
sf::Packet returnTilePacket();
void getAllItems(std::deque<Item*> &items);
bool isCollision();
bool isProjectile();
CreatureDeque& getCreatures();
Position pos;
unsigned char type;
private:
Item* ground;
ItemDeque topItems;
ItemDeque downItems;
CreatureDeque creatures;
};
#endif