forked from cfrantzidis/DungeonExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoom.cs
More file actions
39 lines (34 loc) · 1.03 KB
/
Copy pathRoom.cs
File metadata and controls
39 lines (34 loc) · 1.03 KB
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
namespace DungeonExplorer
using System;
using System.Diagnostics;
namespace DungeonExplorer
{
public class Room
{
private string description;
public string RoomItem { get; set; }
public Room North { get; set; }
public Room East { get; set; }
public Room South { get; set; }
public Room West { get; set; }
public Room(string description)
{
Debug.Assert(!string.IsNullOrWhiteSpace(description), "Room description cannot be empty.");
this.description = description;
}
public void CreateItem(string item)
{
Debug.Assert(!string.IsNullOrWhiteSpace(item), "Item name cannot be empty.");
RoomItem = item;
}
public string GetDescription()
{
return description;
}
public void RemoveItem()
{
Debug.Assert(RoomItem != null, "RemoveItem called, but no item exists in the room right now.");
RoomItem = null;
}
}
}