How timyr-tm/testgame works
TestGame is an experimental Godot game with a reusable C# API and a Roslyn event-subscription generator. The visible runtime workflow begins when Godot readies the main scene, which publishes a setup event through the game event bus; that bus dispatches matching generated handlers. The API also provides generic vector types, with game-side conversions to Godot vectors. Logging is configured through a Godot console sink and structured formatter. World-object types are present, but the excerpts do not show gameplay behavior or scene wiring, so those relationships are omitted.
Main entry points: EventBus.cs Game Event Bus · Main.cs Main Scene · GodotConsoleSink.cs Godot Console Sink · IFloatingVector.cs Floating Vector Interface
Components 21
Godot Runtime
- Main Scene
src/TestGame.Game/src/Main.cs - Game Object Node
src/TestGame.Game/src/World/GameObjectNode.cs - Vector Extensions
src/TestGame.Game/src/Math/VectorExtensions.cs
Event System
- Game Event Bus
src/TestGame.Game/src/Event/EventBus.cs - Setup Event
src/TestGame.Game/src/Event/SetupEvent.cs - Generated Subscribers
src/TestGame.SourceGenerators/src/EventSubsGenerator.cs - Subscription Generator
src/TestGame.SourceGenerators/src/EventSubsGenerator.cs
Game API
- Event Contract
src/TestGame.Api/src/Event/Event.cs - Handler Attribute
src/TestGame.Api/src/Event/EventHandlerAttribute.cs - Bus Interface
src/TestGame.Api/src/Event/IEventBus.cs - Game Object Contract
src/TestGame.Api/src/World/GameObject.cs - Vector Interface
src/TestGame.Api/src/Math/Vectors/IVector.cs - Floating Vector Interface
src/TestGame.Api/src/Math/Vectors/IFloatingVector.cs - 2D Integer Vector
src/TestGame.Api/src/Math/Vectors/Vector2I.cs - 2D Float Vector
src/TestGame.Api/src/Math/Vectors/Vector2F.cs - 3D Integer Vector
src/TestGame.Api/src/Math/Vectors/Vector3I.cs - 3D Float Vector
src/TestGame.Api/src/Math/Vectors/Vector3F.cs
Logging
- Logging Setup
src/TestGame.Game/src/Logging/LoggingSetup.cs - Godot Console Sink
src/TestGame.Game/src/Logging/GodotConsoleSink.cs - Structured Formatter
src/TestGame.Game/src/Logging/StructuredFormatter.cs
Other components
- Godot Engine
Connections 19
- Godot Engine → Main Scene: readies scene
- Main Scene → Setup Event: creates
src/TestGame.Game/src/Main.cs - Main Scene → Game Event Bus: publishes through
src/TestGame.Game/src/Main.cs - Game Event Bus → Generated Subscribers: looks up handlers
src/TestGame.Game/src/Event/EventBus.cs - Subscription Generator → Handler Attribute: finds attributed handlers
src/TestGame.SourceGenerators/src/EventSubsGenerator.cs - Subscription Generator → Event Contract: groups event types
src/TestGame.SourceGenerators/src/EventSubsGenerator.cs - Game Event Bus → Bus Interface: implements
src/TestGame.Game/src/Event/EventBus.cs - Game Event Bus → Event Contract: dispatches events
src/TestGame.Game/src/Event/EventBus.cs - Setup Event → Event Contract: inherits
src/TestGame.Game/src/Event/SetupEvent.cs - 2D Integer Vector → Vector Interface: implements
src/TestGame.Api/src/Math/Vectors/Vector2I.cs - 3D Integer Vector → Vector Interface: implements
src/TestGame.Api/src/Math/Vectors/Vector3I.cs - 2D Float Vector → Floating Vector Interface: implements
src/TestGame.Api/src/Math/Vectors/Vector2F.cs - 3D Float Vector → Floating Vector Interface: implements
src/TestGame.Api/src/Math/Vectors/Vector3F.cs - Floating Vector Interface → Vector Interface: extends
src/TestGame.Api/src/Math/Vectors/IFloatingVector.cs - Vector Extensions → 2D Integer Vector: converts
src/TestGame.Game/src/Math/VectorExtensions.cs - Vector Extensions → 2D Float Vector: converts
src/TestGame.Game/src/Math/VectorExtensions.cs - Logging Setup → Godot Console Sink: configures
src/TestGame.Game/src/Logging/LoggingSetup.cs - Godot Console Sink → Structured Formatter: formats with
src/TestGame.Game/src/Logging/GodotConsoleSink.cs - Godot Console Sink → Godot Engine: prints rich output
src/TestGame.Game/src/Logging/GodotConsoleSink.cs