How janecea/robotfight works
Robot Fight is a terminal programming game: users provide an arena and, on Linux, two C++ robot programs; the application loads configuration, validates the arena, runs a tick-based battle, and displays the result. The graph separates startup and robot integration, simulation, and terminal presentation, with a shared game model layer. Relationships are limited to calls or dependencies visible in the supplied excerpts and SOURCE INDEX; unsampled implementation details are not inferred.
Main entry points: main.cpp Application Startup · game_engine.cpp Fight Engine · game_state.hpp Match State · main_presenter.cpp Game Presenter
Components 19
Startup and Inputs
- Application Startup
source/main.cpp - Configuration
source/game_config.cpp - Arena Parsing
source/boot/arena_parser.cpp - Robot Tick Providers
source/boot/linux_on_tick_provider.cpp - Demo Provider
source/boot/demo_on_tick_provider.cpp
Battle Simulation
- Fight Engine
source/models/game_logic/game_engine.cpp - Robot AI Adapter
source/models/entities/robot_ai.cpp - AI State View
source/models/game_logic/game_state_view.cpp
Game Model
- Combat Actions
source/models/actions/action.hpp - Match State
source/models/game_logic/game_state.hpp - Arena Entities
source/models/entities/entities.hpp - Arena Layout
source/models/arena_layout.hpp - Game Mathematics
source/models/game_math.cpp - Shared Types
source/primitive_types.hpp
Terminal Presentation
- Game Presenter
source/presenters/main_presenter.cpp - Arena Renderer
source/rendering/arena_renderer.cpp - Terminal Frame
source/rendering/frame.cpp - Terminal View
source/views/main_view.cpp
Other components
- Game User
Connections 30
- Game User → Application Startup: starts with inputs
README.md - Application Startup → Configuration: loads configuration
source/main.cpp - Application Startup → Arena Parsing: parses arena
source/main.cpp - Application Startup → Robot Tick Providers: loads robot programs
source/main.cpp - Application Startup → Demo Provider: selects demo robots
source/main.cpp - Application Startup → Fight Engine: constructs match
source/main.cpp - Application Startup → Game Presenter: starts presentation
source/main.cpp - Arena Parsing → Arena Layout: produces layout
- Robot Tick Providers → Robot AI Adapter: provides tick actions
- Demo Provider → Robot AI Adapter: provides tick actions
- Fight Engine → Robot AI Adapter: requests robot actions
- Robot AI Adapter → AI State View: queries match snapshot
source/models/entities/robot_ai.cpp - Fight Engine → Match State: updates match state
- Fight Engine → Game Mathematics: uses simulation helpers
source/models/game_logic/game_engine.cpp - Fight Engine → Combat Actions: dispatches actions
- Match State → Arena Layout: stores arena
source/models/game_logic/game_state.hpp - Match State → Arena Entities: stores entities
source/models/game_logic/game_state.hpp - Game Mathematics → Arena Layout: checks walkability
- Game Mathematics → Arena Entities: updates robot damage
- AI State View → Match State: reads snapshot
- Game Presenter → Fight Engine: advances match
- Game Presenter → Arena Renderer: renders snapshots
- Game Presenter → Terminal View: publishes UI data
- Arena Renderer → Match State: reads match state
- Arena Renderer → Game Mathematics: uses geometry helpers
- Arena Renderer → Terminal Frame: composes frame
- Terminal View → Terminal Frame: displays frame
- Arena Layout → Shared Types
- Arena Entities → Shared Types: uses shared types
source/models/entities/entities.hpp - Combat Actions → Shared Types: uses shared types
source/models/actions/action.hpp