Architecture Diagrams
This page demonstrates the automatically generated architecture diagrams for the GridBuilding plugin using Chickensoft.UMLGenerator.
Overview
The diagrams below are generated automatically from the C# source code using the Chickensoft.UMLGenerator tool. They are rendered to SVG format for inclusion in this static documentation site.
Complete System Architecture
Godot POCS Architecture
This diagram shows the Godot-specific POCS (Proof of Concept/System) entry points that connect Godot components to the pure C# architecture. The architecture demonstrates:
- Godot Entry Points: Main interfaces for Godot scene integration
- POCS Service Locator: Bridge between Godot and pure C# services
- Controller Classes: Godot-specific controllers for placement, manipulation, and targeting
- Pure C# Services: Core business logic separated from Godot dependencies
The POCS architecture enables:
- Clean Separation: Godot UI layer separated from pure C# business logic
- Cross-Engine Compatibility: Services can work with Unity or other engines
- Testability: Pure C# services can be unit tested without Godot dependencies
- Maintainability: Business logic independent of Godot API changes
Individual Component Diagrams
MathUtils Class
This class provides pure C# math utilities that replace Godot’s Mathf class, ensuring AOT compatibility for iOS/Android platforms.
Placement Service
Core service for building placement operations, handling validation and execution of grid-based building placement.
Grid Targeting Service
Manages grid navigation, pathfinding, and tile validation for precise positioning and movement operations.
Manipulation Service
Handles building transformations including move, rotate, and removal operations with state management.
Service Registry
Dependency injection container managing service lifetimes, registration, and resolution across the plugin architecture.
Building System Interfaces
The building system interfaces define the core contracts for grid-based building functionality.
How It Works
- Source Code Annotation: Classes are marked with
[ClassDiagram]attributes - Build-Time Generation: PlantUML (.puml) files are generated during compilation
- Static Rendering: Diagrams are pre-rendered to SVG for static site inclusion
- Hugo Integration: Custom shortcode includes diagrams in documentation
Benefits
- Always Up-to-Date: Diagrams automatically reflect code changes
- Static Site Compatible: No runtime dependencies or JavaScript required
- IDE Integration: Clickable links open source files in your editor
- Version Controlled: Diagrams are part of the documentation repository
Adding New Diagrams
To add architecture diagrams for new components:
- Add
[ClassDiagram(UseVSCodePaths = true)]to classes you want to document - Rebuild the project to generate .puml files
- Run the diagram rendering script:
./scripts/render-plantuml-diagrams.sh - Include diagrams in documentation using:
Diagram not found: ClassName
Run
./scripts/render-plantuml-diagrams.shto generate diagrams.
Future Enhancements
- Integration with Godot scene files (.tscn)
- Relationship diagrams showing dependencies
- Sequence diagrams for workflows
- Interactive diagrams with expandable sections