five-on-it / apps/client/src/ui/studio/edits
apps/client/src/ui/studio/edits
The studio's edits of a city spec, each a pure function from a spec to the next: elements added where the owner clicked (a road through its points, ending on the roads it starts or ends near; a roundabout; a hill; a district's seed; a park; a named place; a grid; a river; a prop in a park; a jetty on a river's bank), one replaced as the inspector or the JSON wrote it, one removed, one of its points moved, the spawn put on a road. A selection names an element by its list and index, or a part of one (a river's jetty, a park's prop) by its element's index and its own (Selection); selectionOfPath finds the element a solver's issue is about from its path (spec.roads[5].from.onto), handlesOf the points of an element the map draws and drags (a road's ends on other roads too, detached when dragged), and referencesTo what names an element (the roads ending on a road, on a hill's top). A river's jetties are the solver's until one is edited: the plan's are written into the spec then. Names are made unique (road-3), as the spec wants them.