Static helper that picks background and stand sprite ids and caption for the current room scene. It chooses between habitat or adventure variants based on LotRunSystem state, maps habitat/adventure ids to sprite ids via switch expressions, and exposes HasBackground/HasStand checks against SpriteCatalog.
namespace NoChillquarium;
/// <summary>
/// World the tank sits in — habitat porch / pool / sewer, or the
/// adventure map you're crawling. Fills the dull play-cabinet blue.
/// </summary>
public static class RoomScene
{
public static string BackgroundId
{
get
{
if ( LotRunSystem.IsOpen && LotRunSystem.Location is not null )
return AdventureBg( LotRunSystem.Location.Id );
return HabitatBg( TankSim.HabitatId );
}
}
public static string StandId
{
get
{
if ( LotRunSystem.IsOpen && LotRunSystem.Location is not null )
return AdventureStand( LotRunSystem.Location.Id );
return HabitatStand( TankSim.HabitatId );
}
}
public static bool HasBackground =>
!string.IsNullOrEmpty( BackgroundId ) && SpriteCatalog.Has( BackgroundId );
public static bool HasStand =>
!string.IsNullOrEmpty( StandId ) && SpriteCatalog.Has( StandId );
public static string Caption
{
get
{
if ( LotRunSystem.IsOpen && LotRunSystem.Location is not null )
return LotRunSystem.Location.Name ?? "";
return TankSim.ActiveHabitat?.Name ?? "";
}
}
static string HabitatBg( string id ) => id switch
{
"bathtub" or "abandoned_spa" => "loc_bathroom",
"kiddie_pool" => "loc_yard",
"neighbor_pool" or "hot_tub_heist" or "community_fountain" => "loc_neighbor",
"lake" => "loc_lake",
"gulf" or "ocean" => "loc_gulf",
"sewage_duct" or "storm_drain" => "loc_sewer",
_ => "loc_porch"
};
static string HabitatStand( string id ) => id switch
{
"bathtub" or "abandoned_spa" => "stand_front_tile",
"kiddie_pool" or "neighbor_pool" or "hot_tub_heist" or "community_fountain" => "stand_front_pool",
"lake" or "gulf" or "ocean" => "stand_front_dock",
"sewage_duct" or "storm_drain" => "stand_front_pipe",
_ => "stand_front_porch"
};
static string AdventureBg( string id ) => id switch
{
"toilet_pipes" or "storm_drain" => "loc_sewer",
"jr_high_night" => "loc_school",
"dark_alley" => "loc_alley",
"neighbor_pool_night" => "loc_neighbor",
"gas_station" => "loc_gas",
"bingo_hall" => "loc_bingo",
_ => "loc_sewer"
};
static string AdventureStand( string id ) => id switch
{
"toilet_pipes" or "storm_drain" => "stand_front_pipe",
"jr_high_night" => "stand_front_tile",
"dark_alley" or "gas_station" => "stand_front_porch",
"neighbor_pool_night" => "stand_front_pool",
"bingo_hall" => "stand_front_tile",
_ => "stand_front_pipe"
};
}