Compose buildings from definitions and interaction components #34
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Building.gd, BuildController.gd, WorldMapContent.gd, and GameState.gd contain repeated building_type switches for visuals, animation, prices, available actions, menus, placement exceptions, production, and map markers. BuildController in particular must know the behavior and UI of every building.
Direction
Create a BuildingDefinition resource for static metadata such as name, icon, cost, map style, and scene. Give building scenes composable capability nodes for behavior and interactions, such as ProductionComponent, InventoryComponent, ResearchProvider, CraftingProvider, and ActionProvider. Context actions should be queried from the selected building rather than assembled by a central building-type switch.
Migrate incrementally, starting with mothership, extractor, transport hub, lab, and ship crafter behavior that already exercises different capabilities.
Acceptance criteria
Implemented in commit
0504b24. Buildings now use BuildingDefinition resources for metadata, costs, menu/map presentation and placement rules; visual scenes compose action providers, while BuildController and GameState query definitions/capabilities. Added test_building_composition plus updated animation, placement, popup, map and replacement regressions. Targeted building tests pass.