-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocation.cs
69 lines (64 loc) · 1.68 KB
/
Location.cs
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
57
58
59
60
61
62
63
64
65
66
67
68
69
public class Location
{
public int ID;
public string Name;
public Location LocationToNorth;
public Location LocationToEast;
public Location LocationToSouth;
public Location LocationToWest;
public Quest QuestAvailableHere;
public Monster MonsterLivingHere;
public Location(int id, string name, string description,string change, string change2 )
{
ID = id;
Name = name;
}
public string Compass()
{
//Settings > Debug > Console: Collapse Identical Lines
string s = "From here you can go:\n";
if (LocationToNorth != null)
{
s += " N\n |\n";
}
if (LocationToWest != null)
{
s += "W---|";
}
else
{
s += " |";
}
if (LocationToEast != null)
{
s += "---E";
}
s += "\n";
if (LocationToSouth != null)
{
s += " |\n S\n";
}
return s;
}
public string NextLocationOptions()
{
string s = "";
if (LocationToNorth != null)
s += "N";
if (LocationToEast != null)
s += "E";
if (LocationToSouth != null)
s += "S";
if (LocationToWest != null)
s += "W";
return s;
}
public Location GetLocationAt(string location)
{
if (location == "N") return LocationToNorth;
if (location == "E") return LocationToEast;
if (location == "S") return LocationToSouth;
if (location == "W") return LocationToWest;
return null;
}
}