/
Cell.h
57 lines (46 loc) · 1002 Bytes
/
Cell.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
49
50
51
52
53
54
55
56
#pragma once
#include "Coord.h"
#include "Actor.h"
#include "Pickup.h"
#include "Shop.h"
class World;
static enum tileType {DUMMY = -1, WALL = 0, FLOOR = 1, UNUSED = 2, STAIRS = 3, SHOP = 4};
class Cell : public Serializeable
{
public:
void serialize(Serializer write);
static Cell* reconstruct(Serializer read);
static World* world;
int zone;
Cell();
Cell(int x, int y);
Cell(tileType typeIn, int tileNumIn, int x, int y);
~Cell();
cint Pos();
int getTile();
void setTile(int);
void setTile(int, tileType);
tileType getType();
bool empty();
int Visibility();
void Visibility(int);
bool hasActor();
Actor* getActor();
void setActor(Actor* entity);
void setActor(Actor entity);
bool hasPickup();
Pickup* getPickup();
void setPickup(Pickup* item);
void setPickup(Pickup item);
void makeStairs();
void makeShop();
Cell* operator+(cint& rhs);
private:
int tileNum;
cint position;
tileType type;
bool isOccupied;
Actor* actor;
Pickup* pickup;
int visibility;
};