Skip to content

building_system_flow_and_architecture.md

This document describes the high-level flow and class interactions for the building system in the Grid Building Plugin.

System Flow Overview

  1. Enter Build Mode
  2. Player triggers build mode (input action).
  3. BuildingSystem is activated and creates a preview object.

  4. Preview Placement

  5. Preview object is positioned by GridTargetingSystem.
  6. PlacementManager and PlacementValidator check if the preview location is valid.
  7. RuleCheckIndicator displays visual feedback by running all assigned TileCheckRules and updating its visuals.

  8. Placement Confirmation

  9. On confirmation, BuildingSystem validates again.
  10. If valid, places the object in the world and emits a success signal.
  11. If invalid, emits a failure signal and logs issues.

Key Classes

  • BuildingSystem: Manages build mode, preview, and placement confirmation.
  • GridTargetingSystem: Handles preview positioning.
  • PlacementManager / PlacementValidator: Validate placement rules.
  • RuleCheckIndicator: Shows visual feedback for tile validity.

See Also


Last updated: 2025-08-07