From 3863356e989903f7d59cb3b6b82da3acb0f2d7f5 Mon Sep 17 00:00:00 2001 From: Shagnor Date: Mon, 2 Jan 2023 21:29:48 +1100 Subject: [PATCH] Implement lmap and add more content for the road grid. --- .../src/message_handler/user_commands.rs | 2 + .../src/message_handler/user_commands/map.rs | 137 +++ blastmud_game/src/static_content/room.rs | 825 +++++++++++++++++- 3 files changed, 935 insertions(+), 29 deletions(-) create mode 100644 blastmud_game/src/message_handler/user_commands/map.rs diff --git a/blastmud_game/src/message_handler/user_commands.rs b/blastmud_game/src/message_handler/user_commands.rs index 11f3d37a..cf6a9d33 100644 --- a/blastmud_game/src/message_handler/user_commands.rs +++ b/blastmud_game/src/message_handler/user_commands.rs @@ -16,6 +16,7 @@ mod ignore; mod less_explicit_mode; mod login; mod look; +mod map; pub mod movement; pub mod parsing; mod quit; @@ -98,6 +99,7 @@ static REGISTERED_COMMANDS: UserVerbRegistry = phf_map! { "l" => look::VERB, "look" => look::VERB, "read" => look::VERB, + "lmap" => map::VERB, "-" => whisper::VERB, "whisper" => whisper::VERB, }; diff --git a/blastmud_game/src/message_handler/user_commands/map.rs b/blastmud_game/src/message_handler/user_commands/map.rs new file mode 100644 index 00000000..0bd7a4eb --- /dev/null +++ b/blastmud_game/src/message_handler/user_commands/map.rs @@ -0,0 +1,137 @@ +use super::{VerbContext, UserVerb, UserVerbRef, UResult, UserError, user_error, + get_player_item_or_fail}; +use async_trait::async_trait; +use ansi::{ansi, flow_around}; +use crate::{ + models::item::Item, + static_content::room::{self, Direction} +}; +use std::sync::Arc; + +pub fn render_lmap(room: &room::Room, width: usize, height: usize, + captions_needed: &mut Vec<(usize, &'static str, &'static str)>) -> String { + let mut buf = String::new(); + let my_loc = &room.grid_coords; + let min_x = my_loc.x - (width as i64) / 2; + let max_x = min_x + (width as i64); + let min_y = my_loc.y - (height as i64) / 2; + let max_y = min_y + (height as i64); + for y in min_y..max_y { + for x in min_x..max_x { + let coord = room::GridCoords { x, y, z: my_loc.z }; + let coord_room = room::room_map_by_zloc() + .get(&(&room.zone, &coord)); + if my_loc.x == x && my_loc.y == y { + buf.push_str(ansi!(" () ")) + } else { + let code_capt_opt = coord_room.map( + |r| if room.zone == r.zone { + (r.short, if r.should_caption { + Some((r.name, ((my_loc.x as i64 - r.grid_coords.x).abs() + + (my_loc.y as i64 - r.grid_coords.y).abs() + ) as usize)) } else { None }) + } else { + r.secondary_zones.iter() + .find(|sz| sz.zone == room.zone) + .map(|sz| (sz.short, sz.caption.map( + |c| (c, ((my_loc.x as i64 - r.grid_coords.x).abs() + + (my_loc.y as i64 - r.grid_coords.y).abs()) + as usize)))) + .expect("Secondary zone missing") + }); + match code_capt_opt { + None => buf.push_str(" "), + Some((code, capt_opt)) => { + if let Some((capt, closeness)) = capt_opt { + captions_needed.push((closeness, code, capt)); + } + buf.push('['); + buf.push_str(code); + buf.push(']'); + } + } + } + match coord_room.and_then( + |r| r.exits.iter().find(|ex| ex.direction == Direction::EAST)) { + None => buf.push(' '), + Some(_) => buf.push('-') + } + } + for x in min_x..max_x { + let mut coord = room::GridCoords { x, y, z: my_loc.z }; + let coord_room = room::room_map_by_zloc() + .get(&(&room.zone, &coord)); + match coord_room.and_then( + |r| r.exits.iter().find(|ex| ex.direction == Direction::SOUTH)) { + None => buf.push_str(" "), + Some(_) => buf.push_str(" | ") + } + let has_se = coord_room.and_then( + |r| r.exits.iter().find(|ex| ex.direction == Direction::SOUTHEAST)) + .is_some(); + coord.y += 1; + let coord_room_s = room::room_map_by_zloc() + .get(&(&room.zone, &coord)); + let has_ne = coord_room_s.and_then( + |r| r.exits.iter().find(|ex| ex.direction == Direction::NORTHEAST)) + .is_some(); + if has_se && has_ne { + buf.push('X'); + } else if has_se { + buf.push('\\'); + } else if has_ne { + buf.push('/'); + } else { + buf.push(' '); + } + } + buf.push('\n'); + } + captions_needed.sort_unstable_by(|a, b| a.0.cmp(&b.0)); + buf +} + +pub fn caption_lmap(captions: &Vec<(usize, &'static str, &'static str)>, width: usize, height: usize) -> String { + let mut buf = String::new(); + for room in captions.iter().take(height) { + buf.push_str(&format!(ansi!("{}: {:.*}\n"), room.1, width, room.2)); + } + buf +} + +pub async fn lmap_room(ctx: &VerbContext<'_>, + room: &room::Room) -> UResult<()> { + let mut captions: Vec<(usize, &'static str, &'static str)> = Vec::new(); + ctx.trans.queue_for_session( + ctx.session, + Some(&flow_around(&render_lmap(room, 9, 7, &mut captions), 45, ansi!(" "), + &caption_lmap(&captions, 14, 27), 31 + )) + ).await?; + Ok(()) +} + +pub struct Verb; +#[async_trait] +impl UserVerb for Verb { + async fn handle(self: &Self, ctx: &mut VerbContext, _verb: &str, remaining: &str) -> UResult<()> { + if remaining.trim() != "" { + user_error("map commands don't take anything after them".to_owned())?; + } + let player_item = get_player_item_or_fail(ctx).await?; + let (heretype, herecode) = player_item.location.split_once("/").unwrap_or(("room", "repro_xv_chargen")); + let room_item: Arc = ctx.trans.find_item_by_type_code(heretype, herecode).await? + .ok_or_else(|| UserError("Sorry, that no longer exists".to_owned()))?; + if room_item.item_type != "room" { + user_error("Can't map here".to_owned())?; + } else { + let room = + room::room_map_by_code().get(room_item.item_code.as_str()) + .ok_or_else(|| UserError("Sorry, that room no longer exists".to_owned()))?; + lmap_room(ctx, &room).await?; + } + Ok(()) + } +} +static VERB_INT: Verb = Verb; +pub static VERB: UserVerbRef = &VERB_INT as UserVerbRef; diff --git a/blastmud_game/src/static_content/room.rs b/blastmud_game/src/static_content/room.rs index 5fe8bd52..7ddf168a 100644 --- a/blastmud_game/src/static_content/room.rs +++ b/blastmud_game/src/static_content/room.rs @@ -134,7 +134,8 @@ pub struct Exit { pub struct SecondaryZoneRecord { pub zone: &'static str, pub short: &'static str, - pub grid_coords: GridCoords + pub grid_coords: GridCoords, + pub caption: Option<&'static str> } pub struct Room { @@ -147,7 +148,8 @@ pub struct Room { pub grid_coords: GridCoords, pub description: &'static str, pub description_less_explicit: Option<&'static str>, - pub exits: Vec + pub exits: Vec, + pub should_caption: bool } static STATIC_ROOM_LIST: OnceCell> = OnceCell::new(); @@ -179,7 +181,8 @@ pub fn room_list() -> &'static Vec { direction: Direction::EAST, target: ExitTarget::UseGPS, exit_type: ExitType::Blocked(&super::npc::statbot::ChoiceRoomBlocker), - }) + }), + should_caption: true }, Room { zone: "repro_xv", @@ -198,7 +201,8 @@ pub fn room_list() -> &'static Vec { direction: Direction::EAST, target: ExitTarget::UseGPS, exit_type: ExitType::Free, - }) + }), + should_caption: true }, Room { zone: "repro_xv", @@ -218,14 +222,16 @@ pub fn room_list() -> &'static Vec { direction: Direction::UP, target: ExitTarget::UseGPS, exit_type: ExitType::Free - }) + }), + should_caption: true }, Room { zone: "repro_xv", secondary_zones: vec!(SecondaryZoneRecord { zone: "melbs", short: ansi!("RL"), - grid_coords: GridCoords { x: 2, y: 0, z: 0 }, + grid_coords: GridCoords { x: 2, y: 1, z: 0 }, + caption: Some("ReproLabs") }), code: "repro_xv_lobby", name: "Lobby", @@ -245,7 +251,8 @@ pub fn room_list() -> &'static Vec { direction: Direction::WEST, target: ExitTarget::Custom("room/melbs_kingst_50"), exit_type: ExitType::Free - }) + }), + should_caption: true }, @@ -255,7 +262,7 @@ pub fn room_list() -> &'static Vec { code: "melbs_kingst_latrobest", name: "King Street & Latrobe St", short: ansi!("##"), - description: "A wide road (5 lanes each way) intersects a narrower 3 lane road. Both have been rather poorly maintained. Potholes dot the ashphalt road.", + description: "A wide road (5 lanes each way) intersects a narrower 3 lane road. Both have been rather poorly maintained. Potholes dot the ashphalt road", description_less_explicit: None, grid_coords: GridCoords { x: 1, y: -5, z: 0 }, exits: vec!( @@ -264,7 +271,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -286,7 +294,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -308,7 +317,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -330,7 +340,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -352,7 +363,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -375,7 +387,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -383,7 +396,8 @@ pub fn room_list() -> &'static Vec { SecondaryZoneRecord { zone: "repro_xv", short: ansi!("EX"), - grid_coords: GridCoords { x: 1, y: 0, z: 0 } + grid_coords: GridCoords { x: 1, y: 0, z: 0 }, + caption: Some("Melbs"), } ), code: "melbs_kingst_50", @@ -409,7 +423,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -431,7 +446,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -439,7 +455,7 @@ pub fn room_list() -> &'static Vec { code: "melbs_kingst_bourkest", name: "King Street & Bourke St", short: ansi!("##"), - description: "A wide road (5 lanes each way) intersects a slightly narrower 4-lane road with wide but heavily cracked concrete footpaths. Potholes dot the ashphalt road.", + description: "A wide road (5 lanes each way) intersects a slightly narrower 4-lane road with wide but heavily cracked concrete footpaths. Potholes dot the ashphalt road", description_less_explicit: None, grid_coords: GridCoords { x: 1, y: 3, z: 0 }, exits: vec!( @@ -453,7 +469,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -475,7 +492,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -497,7 +515,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -519,7 +538,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -541,7 +561,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -563,7 +584,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -585,7 +607,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -607,7 +630,8 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) + ), + should_caption: false, }, Room { zone: "melbs", @@ -615,7 +639,7 @@ pub fn room_list() -> &'static Vec { code: "melbs_kingst_flinderst", name: "King Street & Flinders St", short: ansi!("##"), - description: "A wide road (5 lanes each way) intersects a wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road.", + description: "A wide road (5 lanes each way) intersects a wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", description_less_explicit: None, grid_coords: GridCoords { x: 1, y: 11, z: 0 }, exits: vec!( @@ -624,8 +648,751 @@ pub fn room_list() -> &'static Vec { target: ExitTarget::UseGPS, exit_type: ExitType::Free }, - ) - }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_210", + name: "Flinders St - 210 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 2, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_200", + name: "Flinders St - 200 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 3, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_190", + name: "Flinders St - 190 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 4, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_williamsst_flindersst", + name: "Williams St & Flinders St", + short: ansi!("##"), + description: "An intersection of a steep asphalt road with a wide road with rusted tram tracks in the middle. Potholes dot the road surfaces", + description_less_explicit: None, + grid_coords: GridCoords { x: 5, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_180", + name: "Flinders St - 180 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 6, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_170", + name: "Flinders St - 170 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 7, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_160", + name: "Flinders St - 160 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 8, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_queenst_flindersst", + name: "Queen St & Flinders St", + short: ansi!("##"), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 9, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_150", + name: "Flinders St - 150 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 6, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_140", + name: "Flinders St - 140 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 7, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_130", + name: "Flinders St - 130 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 8, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_elizabethst_flindersst", + name: "Elizabeth St & Flinders St", + short: ansi!("##"), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 9, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_120", + name: "Flinders St - 120 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 10, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_110", + name: "Flinders St - 110 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 11, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_flindersst_100", + name: "Flinders St - 100 block", + short: ansi!("=="), + description: "A wide road with rusted tram tracks in the middle. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 12, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::EAST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_flindersst", + name: "Elizabeth St & Flinders St", + short: ansi!("##"), + description: "The intersection of two wide roads, with rusted tram tracks and infrastructure in the middle. Crumbling bollards line all corners of the intersection, and potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 11, z: 0 }, + exits: vec!( + Exit { + direction: Direction::WEST, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_latrobest", + name: "Swanston Street & Latrobe St", + short: ansi!("##"), + description: "A dilapidated major tram thoroughfare intersects a narrower 3 lane road. Both have been rather poorly maintained. Potholes dot the ashphalt road", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: -5, z: 0 }, + exits: vec!( + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swansonst_10", + name: "Swanston Street - 10 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: -4, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_20", + name: "Swanston Street - 20 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: -3, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_30", + name: "Swanston Street - 30 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: -2, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_lonsdalest", + name: "Swanston Street & Lonsdale St", + short: ansi!("##"), + description: "A dilapidated major tram thoroughfare intersects a narrower 2 lane each way road. Both have been rather poorly maintained. Potholes dot the ashphalt and weeds poke out from cracks in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: -1, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_40", + name: ansi!("Swanston Street - 40 block"), + short: ansi!("||"), + description: ansi!( + "A wide road (5 lanes each way) that has been rather poorly maintained. Potholes dot the ashphalt road, while cracks line the footpaths on either side"), + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 0, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_50", + name: ansi!("Swanston Street - 50 block"), + short: ansi!("||"), + description: ansi!( + "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete"), + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 1, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_60", + name: "Swanston Street - 60 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 2, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_bourkest", + name: "Swanston Street & Bourke St", + short: ansi!("##"), + description: "A dilapidated major tram thoroughfare intersects a slightly narrower 4-lane road with wide but heavily cracked concrete footpaths. Potholes dot the ashphalt and weeds poke out from cracks in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 3, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_70", + name: "Swanston Street - 70 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 4, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_80", + name: "Swanston Street - 80 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 5, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_90", + name: "Swanston Street - 90 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 6, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_collinsst", + name: "Swanston Street & Collins St", + short: ansi!("##"), + description: "A dilapidated major tram thoroughfare intersects another wide 4-lane road. Potholes dot the ashphalt road, while cracks line the footpaths on either side", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 7, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_100", + name: "Swanston Street - 100 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 8, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_110", + name: "Swanston Street - 110 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 9, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + Room { + zone: "melbs", + secondary_zones: vec!(), + code: "melbs_swanstonst_120", + name: "Swanston Street - 120 block", + short: ansi!("||"), + description: "A road that looks to have been a major tram thoroughfare before the collapse. Cracks line the filthy concrete footpaths and rusted tram tracks, and weeds poke out from holes in the concrete", + description_less_explicit: None, + grid_coords: GridCoords { x: 13, y: 10, z: 0 }, + exits: vec!( + Exit { + direction: Direction::NORTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + Exit { + direction: Direction::SOUTH, + target: ExitTarget::UseGPS, + exit_type: ExitType::Free + }, + ), + should_caption: false, + }, + + ).into_iter().collect()) }