A static class that centralises string constants for architectural piece names used by the editor and a few small helpers. It defines many piece name constants, a Side(bool) helper that returns Left/Right, and a Glyph(string) mapping that returns a material icon name for a piece.
namespace Sunless.Architecture;
// THE NAMES A GENERATOR MAY GIVE ITS PIECES, in one place. A piece is addressed by name from three sides - the
// generator that opens the scope, the object it becomes in the scene, and the record an author's collision
// override is filed under - so a name typed out at the emission site is a piece whose override silently stops
// matching the day somebody renames it.
public static class ArchPieces
{
// The eave assembly. Everything hung on the drip line is filed under it, so a house's guttering is one row
// to hide, collide and reason about rather than three scattered down the roof.
public const string Gutters = "Gutters";
public const string Fascia = "Fascia";
public const string Soffit = "Soffit";
public const string Channel = "Channel";
public const string Downpipes = "Downpipes";
public const string Deck = "Deck";
public const string Capping = "Capping";
public const string Frame = "Frame";
public const string EndWalls = "End Walls";
public const string Parapet = "Parapet";
public const string Guardrail = "Guardrail";
public const string Ceiling = "Ceiling";
public const string Cornice = "Cornice";
public const string Lights = "Lights";
public const string Plinth = "Plinth";
public const string Posts = "Posts";
public const string Beams = "Beams";
public const string Balustrade = "Balustrade";
public const string Canopy = "Canopy";
public const string Flashing = "Flashing";
public const string Steps = "Steps";
public const string Ramp = "Ramp";
public const string Cladding = "Cladding";
public const string Openings = "Openings";
public const string Trims = "Trims";
public const string Fittings = "Fittings";
public const string Skirting = "Skirting";
public const string Treads = "Treads";
public const string Stringers = "Stringers";
public const string Enclosure = "Enclosure";
public const string Landings = "Landings";
public const string Shaft = "Shaft";
public const string Footing = "Footing";
public const string Capital = "Capital";
public const string Span = "Span";
public const string Rails = "Rails";
public const string Infill = "Infill";
public const string Coping = "Coping";
public const string Lining = "Lining";
public const string Carriageway = "Carriageway";
public const string Pavement = "Pavement";
public const string Markings = "Markings";
public const string Barrier = "Barrier";
public const string Girder = "Girder";
public const string Bents = "Bents";
public const string Abutments = "Abutments";
public const string Upstand = "Upstand";
public const string Invert = "Invert";
public const string Walkway = "Walkway";
public const string Services = "Services";
public const string Portal = "Portal";
public const string Balcony = "Balcony";
public const string Bars = "Bars";
public const string Sign = "Sign";
public const string Plant = "Plant";
public const string Cables = "Cables";
public const string Brackets = "Brackets";
public const string Pipes = "Pipes";
public const string Retaining = "Retaining";
public const string Interior = "Interior";
public const string Flight = "Flight";
// A side or an end reads as a piece of the thing it belongs to, never as a suffix on its name: Upstand/Left
// groups with Upstand/Right, where Upstand_L and Upstand_R are two unrelated rows that happen to sort together.
public const string Left = "Left";
public const string Right = "Right";
public const string Near = "Near";
public const string Far = "Far";
public static string Side( bool right ) => right ? Right : Left;
// Classic Material Icons only - the editor ships an older set than the web font, and a glyph it does not
// know draws an empty box rather than falling back.
public static string Glyph( string name ) => name switch
{
Gutters or Channel or Downpipes or Pipes => "water_damage",
Fascia or Soffit or Trims or Cornice or Skirting => "horizontal_rule",
Deck or Capping or Coping => "layers",
Frame or Stringers or Beams => "grid_4x4",
EndWalls or Cladding or Parapet or Enclosure or Lining => "crop_square",
Guardrail or Balustrade or Rails or Infill => "fence",
Ceiling or Canopy or Flashing => "roofing",
Openings or Lights => "window",
Posts or Shaft or Footing or Capital or Span or Bents => "view_column",
Steps or Treads or Landings or Ramp => "stairs",
Plinth or Abutments or Invert => "foundation",
Carriageway or Markings => "route",
Pavement or Walkway => "directions_walk",
Girder or Upstand or Barrier => "horizontal_rule",
Portal or Services => "door_front",
Balcony or Interior => "crop_square",
Bars or Retaining => "fence",
Sign => "label",
Plant => "filter_alt",
Cables => "power_input",
Brackets => "build",
Flight => "stairs",
Left or Right or Near or Far => "swap_horiz",
_ => "category"
};
}