-
Notifications
You must be signed in to change notification settings - Fork 0
/
tile.h
49 lines (36 loc) · 953 Bytes
/
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
49
#ifndef __TILE_H__
#define __TILE_H__
#include "subject.h"
#include "observer.h"
#include "posn.h"
#include "entity.h"
class Subject;
struct Posn;
class Tile final : public Subject, public Observer {
Entity *e;
Posn p;
const char base;
char type; // used for printing to display and determining its type
int chamber; // which chamber is it in
public:
// constructor
Tile(Posn p, char type);
// accessors
Posn getPosn() const;
char getType() const override;
int getChamber() const;
// observer methods
//notifies this tile that the thing previously on it has left (and thus revert to default)
void notifyLeave();
void notify(Subject *whoNotified) override;
//void notifyComing(char c);
SubscriptionType getSubType() const override;
// subject methods
Posn getCurPos() const override;
Posn getLastPos() const override;
char getIcon() const override;
// mutators
void setChamber(int cham);
~Tile();
};
#endif