-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroadlocation.h
43 lines (37 loc) · 999 Bytes
/
roadlocation.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
#ifndef ROADLOCATION_H
#define ROADLOCATION_H
#include <stack>
#include <cmath>
#include "world.h"
#include "worldlocation.h"
#include "wildernesslocation.h"
#include "util.h"
#include "travelstate.h"
class RoadLocation : public WorldLocation {
private:
std::map<int,bool> connections; // {north, south, east, west}
int type;
static int connectionsToType(std::map<int,bool>);
std::map<int,int> choices;
public:
RoadLocation(int, int, int);
RoadLocation(std::pair<int,int>, int);
int getType();
WorldLocation* connect(int) override;
void addOptions(std::map<int,std::string>&) override;
void handleInput(int,std::stack<GameState*>&,Player&,World&) override;
enum Type {
NorthSouth = 1,
NorthWest = 2,
NorthEast = 3,
SouthEast = 4,
SouthWest = 5,
EastWest = 6,
NorthSouthEast = 7,
NorthSouthWest = 8,
NorthEastWest = 9,
SouthEastWest = 10,
NorthSouthEastWest = 11
};
};
#endif