-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink.h
38 lines (31 loc) · 1.02 KB
/
link.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
// link.h
// Creates a Link object for each link with information such as type, strength, owner. location and ability casted.
#ifndef link_h
#define link_h
#include <cstddef>
#include "subject.h"
#include "observer.h"
#include "info.h"
#include "state.h"
#include <iostream>
class GraphicsDisplay;
class Link: public Subject<Info, State>, public Observer<Info, State> {
int row, col;
int pnum;
char name;
int strength;
int spaces;
Direction getDir(int row, int col);
Direction newDir(Direction dir);
void helperNotifyMove(Subject<Info, State> &whoNotified);
void helperNotifyReply(Subject<Info, State> &whoNotified);
public:
Link(int row, int col, int pnum, char name, LinkType type, int strength, Ability ab, int spaces = 1);
void notify(Subject<Info, State> &whoNotified) override;
bool move(Direction d);
void remove();
Info getInfo() const override;
void doAbility(Ability ab);
friend std::ostream &operator<<(std::ostream &out, const Link &l);
};
#endif