Skip to content

Commit

Permalink
✨ Move shops to rooms
Browse files Browse the repository at this point in the history
This allows places like rehearsal spaces or concert spaces to have the bar interactions in the correct room.
  • Loading branch information
sleepyfran committed Jul 1, 2023
1 parent b72cfb7 commit f0c37ee
Show file tree
Hide file tree
Showing 26 changed files with 160 additions and 77 deletions.
2 changes: 1 addition & 1 deletion src/Duets.Cli/Text/World/Bar.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open Duets.Entities

let rec description _ (roomType: RoomType) =
match roomType with
| RoomType.Bar ->
| RoomType.Bar _ ->
[ "The bar is bustling with activity as a lively crowd fills every corner. Laughter and conversation echo throughout the room as people jostle for space at the counter. It's a vibrant and energetic atmosphere, with patrons mingling and enjoying their drinks amidst the lively chatter of a packed house."
"The bar is moderately busy, with a comfortable number of patrons scattered across the space. There are enough people to create a pleasant ambiance, but not so many that it feels overcrowded. It's a cozy setting, with pockets of conversation and occasional bursts of laughter breaking the tranquil hum of voices."
"The bar is relatively quiet, with only a few patrons scattered around. The calm atmosphere allows for easy conversation, as individuals sit at the bar or relax in the dimly lit booths. The soft clinking of glasses and the occasional murmurs create a tranquil backdrop, providing a peaceful environment for those seeking a more intimate experience."
Expand Down
2 changes: 1 addition & 1 deletion src/Duets.Cli/Text/World/Cafe.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open Duets.Entities

let rec description _ (roomType: RoomType) =
match roomType with
| RoomType.Cafe ->
| RoomType.Cafe _ ->
[ "The cafe buzzes with activity as a steady stream of customers fills the cozy space. The aroma of freshly brewed coffee permeates the air, blending with the enticing scent of pastries. People gather at the counter, eagerly placing orders and engaging in lively conversations. It's a vibrant and bustling atmosphere, with baristas skillfully crafting drinks amidst the cheerful chatter of a thriving cafe."
"The cafe is moderately busy, with a pleasant number of patrons enjoying their beverages and treats. There are enough people to create a lively ambiance, but still ample space to find a cozy corner to relax. The soft murmur of conversation mingles with the gentle clinking of cups, creating a warm and inviting atmosphere."
"The cafe exudes a calm and tranquil atmosphere, with only a few customers scattered around the comfortable seating arrangements. Soft instrumental music plays in the background, enhancing the serene ambiance. Patrons quietly sip their drinks, immersed in their thoughts or engrossed in a good book. It's a peaceful oasis, perfect for a moment of solitude or a quiet chat with a close friend."
Expand Down
2 changes: 1 addition & 1 deletion src/Duets.Cli/Text/World/ConcertSpace.fs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ and private roomDescription
=
match roomType with
| RoomType.Backstage -> backstageDescription place attendancePercentage
| RoomType.Bar -> barDescription attendancePercentage
| RoomType.Bar _ -> barDescription attendancePercentage
| RoomType.Lobby -> lobbyDescription attendancePercentage
| RoomType.Stage -> stageDescription attendancePercentage
| _ -> failwith "Room type not supported in concert space"
Expand Down
2 changes: 1 addition & 1 deletion src/Duets.Cli/Text/World/RehearsalSpace.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open Duets.Entities

let rec description (place: Place) (roomType: RoomType) =
match roomType with
| RoomType.Bar ->
| RoomType.Bar _ ->
"The bar is managed by the same person that takes care of the rooms. It's a small place, but it has a decent selection of drinks and snacks"
| RoomType.Lobby ->
"The entrance of the building is decorated with posters of bands that have rehearsed here before, there's a board with the schedule of the rooms and some hand-written ads of bands looking for members"
Expand Down
2 changes: 1 addition & 1 deletion src/Duets.Cli/Text/World/Restaurant.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open Duets.Entities

let rec description _ (roomType: RoomType) =
match roomType with
| RoomType.Restaurant ->
| RoomType.Restaurant _ ->
[ "The restaurant hums with activity as a vibrant crowd fills every table. The aroma of delicious cuisine wafts through the air, enticing patrons with its mouthwatering allure. Waitstaff expertly navigate the lively dining room, attending to the needs of guests with a blend of efficiency and warmth. It's a lively and bustling atmosphere, with the clinking of cutlery and animated conversations creating a symphony of dining delight."
"The restaurant is moderately busy, with a comfortable number of diners occupying the well-appointed tables. The gentle buzz of conversation intertwines with the soothing background music, creating a pleasant ambiance. The attentive waitstaff move gracefully between tables, ensuring a seamless dining experience. It's an inviting setting, perfect for intimate gatherings or enjoyable meals with friends and family."
"The restaurant exudes an elegant and refined atmosphere, with only a few select diners savoring their meals in a spacious dining area. Soft lighting illuminates the tastefully decorated interior, casting a warm glow over the room. The attentive waitstaff provide personalized service, attending to each guest's needs with care and attention to detail. It's a sophisticated haven, ideal for those seeking an exclusive dining experience or a quiet celebration."
Expand Down
6 changes: 3 additions & 3 deletions src/Duets.Cli/Text/World/World.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ let placeTypeName (placeType: PlaceTypeIndex) =
let roomName (room: RoomType) =
match room with
| RoomType.Backstage -> "backstage"
| RoomType.Bar -> "bar area"
| RoomType.Cafe -> "cafe area"
| RoomType.Bar _ -> "bar area"
| RoomType.Cafe _ -> "cafe area"
| RoomType.Bedroom -> "bedroom"
| RoomType.Kitchen -> "kitchen"
| RoomType.LivingRoom -> "living room"
| RoomType.Lobby -> "lobby"
| RoomType.MasteringRoom -> "mastering room"
| RoomType.RecordingRoom -> "recording room"
| RoomType.RehearsalRoom -> "rehearsal room"
| RoomType.Restaurant -> "restaurant"
| RoomType.Restaurant _ -> "restaurant"
| RoomType.SecurityControl -> "security control"
| RoomType.Stage -> "stage"

Expand Down
7 changes: 5 additions & 2 deletions src/Duets.Common/List.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ let forall2' predicate source1 source2 =
with _ ->
false

/// Flattens any list of lists into a single list.
let flatten list = List.collect id list

/// Returns a list created from a map that transforms the KeyValuePair given
/// by `ofSeq` into an actual tuple.
let ofMap (map: Map<_, _>) =
List.ofSeq map |> List.map (fun kvp -> (kvp.Key, kvp.Value))

/// Returns a list created from the keys of a map ignoring its values.
let ofMapKeys (map: Map<_, _>) =
List.ofSeq map |> List.map (fun kvp -> kvp.Key)
List.ofSeq map |> List.map (fun kvp -> kvp.Key)

/// Returns a list created from the values of a map ignoring its keys.
let ofMapValues (map: Map<_, _>) =
Expand Down
4 changes: 2 additions & 2 deletions src/Duets.Data/World/Cities/Madrid/Madrid.Bars.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ let addWrongWay zone =
{ AvailableItems = CityCommonItems.beers @ CityCommonItems.pubFood
PriceModifier = 3<multiplier> }

let bar = World.Node.create 0 RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create 0

let roomGraph = World.Graph.from bar

World.Place.create
("1085e199-f5ad-4011-bc7e-4c55dbd4a25e" |> Identity.from)
"Wrong Way"
70<quality>
(Bar shop)
Bar
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.barOpeningHours
Expand Down
8 changes: 4 additions & 4 deletions src/Duets.Data/World/Cities/Madrid/Madrid.Cafes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ let addAmbuCoffee zone =
{ AvailableItems = Everywhere.Common.coffeeShopItems
PriceModifier = 2<multiplier> }

let cafe = World.Node.create 0 RoomType.Cafe
let cafe = RoomType.Cafe shop |> World.Node.create 0

let roomGraph = World.Graph.from cafe

World.Place.create
("edaf78ca-c2b9-460b-b9e0-c2dcd9e64922" |> Identity.from)
"Ambu Coffee"
90<quality>
(Cafe shop)
Cafe
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.cafeOpeningHours
Expand All @@ -27,15 +27,15 @@ let addMisionCafe zone =
{ AvailableItems = Everywhere.Common.coffeeShopItems
PriceModifier = 2<multiplier> }

let cafe = World.Node.create 0 RoomType.Cafe
let cafe = RoomType.Cafe shop |> World.Node.create 0

let roomGraph = World.Graph.from cafe

World.Place.create
("4c5988c1-90cf-4ea0-9336-bb9a38836eba" |> Identity.from)
"Misión Cafe"
85<quality>
(Cafe shop)
Cafe
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.cafeOpeningHours
Expand Down
3 changes: 3 additions & 0 deletions src/Duets.Data/World/Cities/Madrid/Madrid.CommonItems.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ let beers =

/// List of most common food sold in Madrid pubs.
let pubFood = [ Food.FastFood.genericNachos; Food.FastFood.genericChips ]

/// List of most common items sold in Madrid pubs.
let commonBar = beers @ pubFood
36 changes: 30 additions & 6 deletions src/Duets.Data/World/Cities/Madrid/Madrid.ConcertSpaces.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ open Duets.Data.World
let addBut zone =
let concertSpace = { Capacity = 1000 }

let shop =
{ AvailableItems = CityCommonItems.commonBar
PriceModifier = 2<multiplier> }

let lobby = World.Node.create Ids.ConcertSpace.lobby RoomType.Lobby
let bar = World.Node.create Ids.ConcertSpace.bar RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create Ids.ConcertSpace.bar
let stage = World.Node.create Ids.ConcertSpace.stage RoomType.Stage

let backstage =
Expand All @@ -33,8 +37,12 @@ let addBut zone =
let addCaracol zone =
let concertSpace = { Capacity = 500 }

let shop =
{ AvailableItems = CityCommonItems.commonBar
PriceModifier = 2<multiplier> }

let lobby = World.Node.create Ids.ConcertSpace.lobby RoomType.Lobby
let bar = World.Node.create Ids.ConcertSpace.bar RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create Ids.ConcertSpace.bar
let stage = World.Node.create Ids.ConcertSpace.stage RoomType.Stage

let backstage =
Expand All @@ -60,8 +68,12 @@ let addCaracol zone =
let addMon zone =
let concertSpace = { Capacity = 1200 }

let shop =
{ AvailableItems = CityCommonItems.commonBar
PriceModifier = 2<multiplier> }

let lobby = World.Node.create Ids.ConcertSpace.lobby RoomType.Lobby
let bar = World.Node.create Ids.ConcertSpace.bar RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create Ids.ConcertSpace.bar
let stage = World.Node.create Ids.ConcertSpace.stage RoomType.Stage

let backstage =
Expand All @@ -87,8 +99,12 @@ let addMon zone =
let addNuevoApolo zone =
let concertSpace = { Capacity = 1160 }

let shop =
{ AvailableItems = CityCommonItems.commonBar
PriceModifier = 2<multiplier> }

let lobby = World.Node.create Ids.ConcertSpace.lobby RoomType.Lobby
let bar = World.Node.create Ids.ConcertSpace.bar RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create Ids.ConcertSpace.bar
let stage = World.Node.create Ids.ConcertSpace.stage RoomType.Stage

let backstage =
Expand All @@ -114,8 +130,12 @@ let addNuevoApolo zone =
let addShoko zone =
let concertSpace = { Capacity = 900 }

let shop =
{ AvailableItems = CityCommonItems.commonBar
PriceModifier = 2<multiplier> }

let lobby = World.Node.create Ids.ConcertSpace.lobby RoomType.Lobby
let bar = World.Node.create Ids.ConcertSpace.bar RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create Ids.ConcertSpace.bar
let stage = World.Node.create Ids.ConcertSpace.stage RoomType.Stage

let backstage =
Expand All @@ -141,8 +161,12 @@ let addShoko zone =
let addWurlitzer zone =
let concertSpace = { Capacity = 170 }

let shop =
{ AvailableItems = CityCommonItems.commonBar
PriceModifier = 2<multiplier> }

let lobby = World.Node.create Ids.ConcertSpace.lobby RoomType.Lobby
let bar = World.Node.create Ids.ConcertSpace.bar RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create Ids.ConcertSpace.bar
let stage = World.Node.create Ids.ConcertSpace.stage RoomType.Stage

let backstage =
Expand Down
6 changes: 5 additions & 1 deletion src/Duets.Data/World/Cities/Madrid/Madrid.RehearsalSpaces.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ let addJackOnTheRocks zone =
let addPandorasVox zone =
let rehearsalSpace = { Price = 65m<dd> }

let shop =
{ AvailableItems = CityCommonItems.commonBar
PriceModifier = 2<multiplier> }

let lobby = World.Node.create 0 RoomType.Lobby
let bar = World.Node.create 1 RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create 1
let room1 = World.Node.create 2 RoomType.RehearsalRoom
let room2 = World.Node.create 3 RoomType.RehearsalRoom
let room3 = World.Node.create 4 RoomType.RehearsalRoom
Expand Down
8 changes: 4 additions & 4 deletions src/Duets.Data/World/Cities/Madrid/Madrid.Restaurants.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ let addSumo zone =
{ AvailableItems = food @ drinks
PriceModifier = 2<multiplier> }

let restaurant = World.Node.create 0 RoomType.Restaurant
let restaurant = RoomType.Restaurant shop |> World.Node.create 0

let roomGraph = World.Graph.from restaurant

World.Place.create
("3b2e4bae-bcc5-49ab-af49-233a3375d157" |> Identity.from)
"SUMO"
88<quality>
(Restaurant shop)
Restaurant
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.restaurantOpeningHours
Expand All @@ -42,15 +42,15 @@ let addHonestGreens zone =
{ AvailableItems = food @ drinks
PriceModifier = 2<multiplier> }

let restaurant = World.Node.create 0 RoomType.Restaurant
let restaurant = RoomType.Restaurant shop |> World.Node.create 0

let roomGraph = World.Graph.from restaurant

World.Place.create
("05711260-f915-4f0a-8209-3599b8780f4f" |> Identity.from)
"Honest Greens"
92<quality>
(Restaurant shop)
Restaurant
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.restaurantOpeningHours
Expand Down
8 changes: 4 additions & 4 deletions src/Duets.Data/World/Cities/Prague/Prague.Bars.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ let addBeerGeek zone =
{ AvailableItems = CityCommonItems.beers @ CityCommonItems.pubFood
PriceModifier = 3<multiplier> }

let bar = World.Node.create 0 RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create 0

let roomGraph = World.Graph.from bar

World.Place.create
("570c6572-22b6-43e8-a162-5ba44a00a489" |> Identity.from)
"Beer Geek"
80<quality>
(Bar shop)
Bar
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.barOpeningHours
Expand All @@ -27,15 +27,15 @@ let addPubble zone =
{ AvailableItems = CityCommonItems.beers @ CityCommonItems.pubFood
PriceModifier = 2<multiplier> }

let bar = World.Node.create 0 RoomType.Bar
let bar = RoomType.Bar shop |> World.Node.create 0

let roomGraph = World.Graph.from bar

World.Place.create
("a1fe2d4d-e16e-4204-ba6f-0675c9defa19" |> Identity.from)
"Pubble"
85<quality>
(Bar shop)
Bar
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.barOpeningHours
Expand Down
8 changes: 4 additions & 4 deletions src/Duets.Data/World/Cities/Prague/Prague.Cafes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ let addMamaCoffee zone =
{ AvailableItems = Everywhere.Common.coffeeShopItems
PriceModifier = 2<multiplier> }

let cafe = World.Node.create 0 RoomType.Cafe
let cafe = RoomType.Cafe shop |> World.Node.create 0

let roomGraph = World.Graph.from cafe

World.Place.create
("1e9de63f-c248-4b35-b964-676f8139fa94" |> Identity.from)
"Mama Coffee"
85<quality>
(Cafe shop)
Cafe
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.cafeOpeningHours
Expand All @@ -27,15 +27,15 @@ let addTheMiners zone =
{ AvailableItems = Everywhere.Common.coffeeShopItems
PriceModifier = 2<multiplier> }

let cafe = World.Node.create 0 RoomType.Cafe
let cafe = RoomType.Cafe shop |> World.Node.create 0

let roomGraph = World.Graph.from cafe

World.Place.create
("ce9a608c-8e39-4456-9c10-fc48d8f25fc6" |> Identity.from)
"The Miners"
75<quality>
(Cafe shop)
Cafe
roomGraph
zone
|> World.Place.changeOpeningHours Everywhere.Common.cafeOpeningHours
Expand Down
3 changes: 3 additions & 0 deletions src/Duets.Data/World/Cities/Prague/Prague.CommonItems.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ let pubFood =
[ Food.FastFood.genericBurger
Food.FastFood.genericFries
Food.FastFood.genericNachos ]

/// List of most common items sold in pubs in Prague.
let commonBar = beers @ pubFood
Loading

0 comments on commit f0c37ee

Please sign in to comment.