-
Notifications
You must be signed in to change notification settings - Fork 0
/
wall.h
36 lines (29 loc) · 1.06 KB
/
wall.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
#ifndef WALL_H
#define WALL_H
#include "cell.h"
class Wall final : public Cell{
bool isHorizontal;
// protected:
// int x = 0, y = 0; inherited from Cell
// bool isOccupied = false; inherited from Cell
// Stuff *occupant = nullptr; inherited from Cell
// TextDisplay *td = nullptr; inherited from Cell
public:
Wall(int x, int y, bool isHor) : Cell{x, y}, isHorizontal{isHor} {
isOccupied = true;
}
bool checkOccupancy() const override { return true; } // inherited from Cell
char getChar() const override {
if (isHorizontal) return '-';
return '|';
} // inherited from Cell
// void setObserver(TextDisplay *td) { this->td = td;}; inherited from Cell
// void notifyObserver() { td->notify(x,y,getChar()); }; inherited from Cell
// Stuff * getOccupant(); inherited from Cell
// Stuff* detachStuff(); inherited from Cell
// void setOccupancy; inherited from Cell
// void setOccupant; inherited from Cell
// int getX() const; inherited from Cell
// int getY() const; inherited from Cell
};
#endif