Skip to content

Engine Decoupling — Phase 3: TUI adapter development #3

@JohnLudlow

Description

@JohnLudlow

Summary

Implement a terminal-based UI adapter that renders directly to a console/terminal and provides a low-dependency UI for debugging, automation, and low-graphics platforms.

Objective

Render directly to a terminal/console (ANSI/VT or platform console APIs) without relying on an existing graphics engine.

Constraints

  • TUI adapter must implement control rendering, sizing/positioning, colours and theming using only terminal drawing operations.
  • Must not depend on an external graphics engine.

Technical Details

  • Implement rendering primitives for characters, colour blocks, and simple layout; map IRenderContext UI primitives to terminal drawing operations.
  • Implement input mapping from console keys to IInputProvider events, including mouse support where available.
  • Implement a minimal layout engine for control sizing/positioning, theming and hit-testing.
  • Provide fallback rendering (monochrome, simplified layouts) for terminals lacking complex text attributes.

Requirements

  • (Not started) TUI adapter supports UI rendering, interactions and input mapping for common screens (city panel, unit panel, map viewport).
    • GIVEN a set of UI screens and control definitions
    • WHEN run with TUI adapter
    • THEN UI layout, rendering and interactions behave acceptably for gameplay purposes.

Acceptance Criteria

  • TUI adapter implements all Phase 1 contracts.
  • Renders city panel, unit panel, and map viewport screens.
  • Mouse support implemented where platform allows; keyboard fallback always available.
  • Monochrome/simplified fallback rendering for restricted terminals.
  • Theming and hit-testing functional.

Dependencies

Parent: #2
Blocked by: Phase 1 interfaces (#11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-libItems related to reusable librariesarea-technicalsystemsInternal systems to do with game developmentenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions