-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemImport.example3
189 lines (184 loc) · 4.85 KB
/
ItemImport.example3
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
using HouseCS.Items;
using HouseCS.Items.Clothes;
using HouseCS.Items.Containers;
using System.Collections.Generic;
namespace HouseCS {
/// <summary>
/// ItemImport, stores all items, floors, and houses
/// </summary>
public class ItemImport {
/// <summary>
/// Item cache for floor construction, functions like a stack
/// </summary>
private static readonly List<IItem> cache = new List<IItem>();
/// <summary>
/// Adds an Item to end of cache
/// </summary>
/// <param name="itm">Item to add</param>
/// <returns>Item added</returns>
private static IItem Cache(IItem itm) {
cache.Add(itm);
return itm;
}
/// <summary>
/// Removes Item from start of cache
/// </summary>
/// <returns>Removed Item</returns>
private static IItem Cache() {
if (cache.Count == 0)
return new Empty();
IItem r = cache[0];
cache.Remove(r);
return r;
}
/// <summary>
/// Houses in the program
/// </summary>
public static List<House> houses = new List<House>()
{
new House(0, new List<Floor>()
{
new Floor(new List<IItem>()
{
new Fridge(new List<IItem>()
{
new Book("One", "Two", 0),
new Book("Four", "Five", 0),
}, true, string.Empty),
new Fridge(new List<IItem>()
{
new Book("Seven", "Eight", 0),
}, true, "Old Fridge"),
new Table(new List<IItem>()
{
new Computer("Lenovo", "Legion", "Y750 15\"", true, "Laptop", "Laptop"),
}, "Dining Table"),
}, new List<int>() {
0, 4, 1
}, false, new List<string>() {
"Kitchen",
"Dining Room",
"Family Room",
"Laundry Room",
"Garage",
}),
new Floor(new List<IItem>()
{
new Container(new List<IItem>()
{
new Display(false, new List<IItem>()
{
Cache(new GameConsole(0, "Nintendo", "NES", "Nintendo")),
Cache(new GameConsole(0, "Atari", "VCS 2600", "Atari")),
Cache(new GameConsole(0, "Nintendo", "GameCube", "GameCube")),
}, 30, "CRT"),
new Computer("Tandy", "1000", "TL/2", false, "Desktop", "Tandy"),
}, "Entertainment Center"),
new Table(new List<IItem>()
{
Cache(),
Cache(),
}, "Game Table"),
new Table(new List<IItem>()
{
Cache()
}, "TV Dinner Table"),
new Table(new List<IItem>()
{
new Display(true, new List<IItem>()
{
Cache(new Computer("Gateway", "510", "xl", false, "Desktop", "Win XP"))
}, 18, "Old 5:4 Monitor"),
new Display(true, new List<IItem>()
{
Cache(Cache()),
}, 24, "Widescreen Monitor"),
Cache()
}, "Desk"),
new Bookshelf(new List<Book>()
{
new Book("The Hobbit", "J.R.R. Tolkien", 1937),
new Book("The Complete: Calvin & Hobbes", "Bill Watterson", 2005),
}, string.Empty),
new Display(false, new List<IItem>()
{
Cache(new GameConsole(2, "Nintendo", "Switch", "Switch")),
Cache(new GameConsole(0, "Microsoft", "Xbox 360", "Xbox")),
}, 40, "LED"),
new GameConsole(1, "Nintendo", "GameBoy Advance SP", "GBA SP"),
Cache(),
Cache(),
new Bed(false, 0, string.Empty),
new Bed(false, 1, string.Empty),
new Dresser(new List<Clothing>()
{
new Shirt("Red", string.Empty),
new Pants("Blue", string.Empty),
new Pants("Black", string.Empty),
}, string.Empty),
new Dresser(new List<Clothing>()
{
new Pants("Black", string.Empty),
new Pants("Gray", string.Empty),
new Pants("Blue", string.Empty),
}, string.Empty),
}, new List<int>()
{
2, 2, 2, 2, 4, 2, 2, 2, 2, 0, 4, 0, 4
}, false, new List<string>()
{
"Master Bedroom",
"Office",
"Game Room",
"Master Bathroom",
"Bedroom",
}),
}, true, 3, 74, 121, 1), // My House
new House(6, new List<Floor>()
{
new Floor(),
new Floor(new List<IItem>()
{
new Table(),
}, new List<int>()
{
0
}, false, new List<string>()
{
"Room"
}),
new Floor(),
}, false, 0, 98, 43, 2), // Jim's House
new House(0, new List<Floor>()
{
new Floor(new List<IItem>()
{
new Fridge(new List<IItem>(), true, string.Empty),
}, new List<int>()
{
0
}, false, new List<string>()
{
"Kitchen",
"Living Room",
"Family Room",
"Garage",
}),
new Floor(new List<IItem>(), new List<int>(), false, new List<string>()
{
"Bedroom 1",
"Master Bedroom",
"Bedroom 2",
"Office",
"Bathroom",
}),
}, false, 1, 98, 43, 2), // Becca's House
};
/// <summary>
/// Item (house/floor) initializer
/// </summary>
public static void InitializeItems() { //this method is required, though it doesn't actually need to do anything if you define all the items in the variable from the start, however I will eventually use this method to add a "reset" functionality
//Told you it could be empty :p
}
}
}