How snowbillr/turn-based-game-engine works
Core Components Layer
• Engine (engine.ts) - Central coordinator
• Flow (flow.ts) - Game flow controller
• FlowBuilder (flow_builder.ts) - Game flow construction
• FlowNode (flow_node.ts) - Individual game states
• Player (player.ts) - Player management
• Data Structures (queue.ts, stack.ts) - Supporting components
Game Implementation Layer
• How specific games (like Tic-tac-toe) are implemented:
• Board (board.ts) and game-specific main.ts
• How it connects to the core engine
Component Relationships
• Flow Builder → Flow (creation relationship)
• Flow → Flow Node (composition)
• Engine → Flow (management)
• Engine → Player (coordination)
• Game Implementation → Engine (usage)
• [Game Implementation Layer]
• ↓
• [Core Engine Layer]
• ↓
• [Data Structures Layer]
Important Details
• Extensibility points where new games can be implemented
• Turn-based nature of the engine
• Flow control mechanisms
• How state management works between components