๐Ÿ“ฆ sleepyfran / duets

๐Ÿ“„ Layouts.fs ยท 354 lines
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354module Duets.Data.World.Cities.Layouts

open Duets.Entities
open Duets.Data.World

/// Usual layout for a restaurant.
let restaurantRoomLayout menu =
    let kitchen =
        RoomType.Kitchen
        |> World.Room.create
        |> World.Node.create Ids.Restaurant.kitchen

    let diningRoom =
        RoomType.Restaurant menu
        |> World.Room.create
        |> World.Node.create Ids.Common.restaurant

    World.Graph.fromMany [ diningRoom; kitchen ]
    |> World.Graph.connect kitchen.Id diningRoom.Id North

/// Usual layout for a bar.
let barRoomLayout =
    RoomType.Bar
    |> World.Room.create
    |> World.Node.create Ids.Common.bar
    |> World.Graph.from

/// Usual layout for a bookstore.
let bookstoreLayout =
    RoomType.ReadingRoom
    |> World.Room.create
    |> World.Node.create Ids.Bookstore.readingRoom
    |> World.Graph.from

/// Usual layout for a cafe.
let cafeRoomLayout =
    RoomType.Cafe
    |> World.Room.create
    |> World.Node.create Ids.Common.cafe
    |> World.Graph.from

/// Usual layout for a car dealer.
let carDealerLayout =
    RoomType.ShowRoom
    |> World.Room.create
    |> World.Node.create Ids.CarDealer.showRoom
    |> World.Graph.from

/// Usual layout for a casino.
let casinoLayout =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let bar =
        RoomType.Bar |> World.Room.create |> World.Node.create Ids.Common.bar

    let casinoFloor =
        RoomType.CasinoFloor
        |> World.Room.create
        |> World.Node.create Ids.Casino.casinoFloor

    World.Graph.fromMany [ lobby; bar; casinoFloor ]
    |> World.Graph.connectMany
        [ lobby.Id, bar.Id, East; lobby.Id, casinoFloor.Id, North ]

/// Usual layout for a gym.
let gymLayout =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let changingRoom =
        RoomType.ChangingRoom
        |> World.Room.create
        |> World.Node.create Ids.Gym.changingRoom

    let gym = RoomType.Gym |> World.Room.create |> World.Node.create Ids.Gym.gym

    World.Graph.fromMany [ lobby; changingRoom; gym ]
    |> World.Graph.connectMany
        [ lobby.Id, changingRoom.Id, East; changingRoom.Id, gym.Id, North ]

/// Usual layout for a home.
let homeLayout =
    let kitchen =
        RoomType.Kitchen
        |> World.Room.create
        |> World.Node.create Ids.Home.kitchen

    let livingRoom =
        RoomType.LivingRoom
        |> World.Room.create
        |> World.Node.create Ids.Home.livingRoom

    let bedroom =
        RoomType.Bedroom
        |> World.Room.create
        |> World.Node.create Ids.Home.bedroom

    World.Graph.fromMany [ kitchen; livingRoom; bedroom ]
    |> World.Graph.connectMany
        [ kitchen.Id, livingRoom.Id, South; livingRoom.Id, bedroom.Id, South ]

/// Usual layout for a hotel.
let hotelLayout =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let bar =
        RoomType.Bar |> World.Room.create |> World.Node.create Ids.Common.bar

    let bedroom =
        RoomType.Bedroom
        |> World.Room.create
        |> World.Node.create Ids.Home.bedroom

    World.Graph.fromMany [ lobby; bar; bedroom ]
    |> World.Graph.connectMany
        [ lobby.Id, bar.Id, East; lobby.Id, bedroom.Id, North ]

/// Usual layout for a merchandise workshop.
let merchandiseWorkshopLayout =
    let workshop =
        RoomType.Workshop
        |> World.Room.create
        |> World.Node.create Ids.Workshop.workshop

    World.Graph.from workshop

/// Usual layout for a radio studio.
let radioStudioLayout =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let recordingRoom =
        RoomType.RecordingRoom
        |> World.Room.create
        |> World.Node.create Ids.Studio.recordingRoom

    World.Graph.fromMany [ lobby; recordingRoom ]
    |> World.Graph.connect lobby.Id recordingRoom.Id North

/// First option of a layout for a concert space.
let concertSpaceLayout1 =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let bar =
        RoomType.Bar |> World.Room.create |> World.Node.create Ids.Common.bar

    let stage =
        RoomType.Stage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.stage

    let backstage =
        RoomType.Backstage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.backstage

    World.Graph.fromMany [ lobby; bar; stage; backstage ]
    |> World.Graph.connectMany
        [ lobby.Id, bar.Id, East
          lobby.Id, stage.Id, North
          lobby.Id, backstage.Id, West
          backstage.Id, stage.Id, NorthEast ]

/// Second option of a layout for a concert space.
let concertSpaceLayout2 =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let bar =
        RoomType.Bar |> World.Room.create |> World.Node.create Ids.Common.bar

    let stage =
        RoomType.Stage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.stage

    let backstage =
        RoomType.Backstage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.backstage

    World.Graph.fromMany [ lobby; bar; stage; backstage ]
    |> World.Graph.connectMany
        [ lobby.Id, bar.Id, West
          bar.Id, stage.Id, North
          bar.Id, backstage.Id, NorthEast
          backstage.Id, stage.Id, West ]

/// Third option of a layout for a concert space.
let concertSpaceLayout3 =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let bar =
        RoomType.Bar |> World.Room.create |> World.Node.create Ids.Common.bar

    let stage =
        RoomType.Stage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.stage

    let backstage =
        RoomType.Backstage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.backstage

    World.Graph.fromMany [ lobby; bar; stage; backstage ]
    |> World.Graph.connectMany
        [ lobby.Id, bar.Id, North
          bar.Id, stage.Id, West
          lobby.Id, backstage.Id, West
          backstage.Id, stage.Id, North ]

/// Fourth option of a layout for a concert space.
let concertSpaceLayout4 =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let bar =
        RoomType.Bar |> World.Room.create |> World.Node.create Ids.Common.bar

    let stage =
        RoomType.Stage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.stage

    let backstage =
        RoomType.Backstage
        |> World.Room.create
        |> World.Node.create Ids.ConcertSpace.backstage

    World.Graph.fromMany [ lobby; bar; stage; backstage ]
    |> World.Graph.connectMany
        [ lobby.Id, bar.Id, North
          bar.Id, stage.Id, East
          lobby.Id, backstage.Id, East
          backstage.Id, stage.Id, North ]

/// Usual layout for an airport.
let airportLayout =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let securityControl =
        RoomType.SecurityControl
        |> World.Room.create
        |> World.Node.create Ids.Airport.securityControl

    let boardingGate =
        RoomType.BoardingGate
        |> World.Room.create
        |> World.Node.create Ids.Airport.boardingGate

    let cafe =
        RoomType.Cafe |> World.Room.create |> World.Node.create Ids.Common.cafe

    let restaurant =
        RoomType.Restaurant RestaurantCuisine.American
        |> World.Room.create
        |> World.Node.create Ids.Common.restaurant

    World.Graph.fromMany
        [ lobby; securityControl; boardingGate; cafe; restaurant ]
    |> World.Graph.connectMany
        [ lobby.Id, securityControl.Id, West
          boardingGate.Id, cafe.Id, North
          boardingGate.Id, restaurant.Id, South ]

/// Usual layout for a metro station.
let metroLayout =
    let platform =
        RoomType.Platform
        |> World.Room.create
        |> World.Node.create Ids.Metro.platform

    World.Graph.from platform

/// Usual layout for a rehearsal space.
let rehearsalSpaceLayout =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    let bar =
        RoomType.Bar |> World.Room.create |> World.Node.create Ids.Common.bar

    let room1 =
        RoomType.RehearsalRoom
        |> World.Room.create
        |> World.Node.create (Ids.RehearsalRoom.room 1)

    let room2 =
        RoomType.RehearsalRoom
        |> World.Room.create
        |> World.Node.create (Ids.RehearsalRoom.room 2)

    let room3 =
        RoomType.RehearsalRoom
        |> World.Room.create
        |> World.Node.create (Ids.RehearsalRoom.room 3)

    World.Graph.fromMany [ lobby; bar; room1; room2; room3 ]
    |> World.Graph.connectMany
        [ lobby.Id, bar.Id, East
          lobby.Id, room1.Id, North
          lobby.Id, room2.Id, NorthWest
          lobby.Id, room3.Id, West ]

/// Usual layout for a studio.
let studioLayout =
    let masteringRoom =
        RoomType.MasteringRoom
        |> World.Room.create
        |> World.Node.create Ids.Studio.masteringRoom

    let recordingRoom =
        RoomType.RecordingRoom
        |> World.Room.create
        |> World.Node.create Ids.Studio.recordingRoom

    World.Graph.fromMany [ masteringRoom; recordingRoom ]
    |> World.Graph.connectMany [ masteringRoom.Id, recordingRoom.Id, North ]

/// Usual layout for a hospital.
let hospitalLayout =
    let lobby =
        RoomType.Lobby
        |> World.Room.create
        |> World.Node.create Ids.Common.lobby

    World.Graph.from lobby