From 8b84297b4192598a3298985a4df3b1550c3b021e Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Mon, 20 Apr 2026 07:34:32 +0200 Subject: [PATCH] update architecture.md so that we can use QVector2D in the lib --- docs/architecture.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 1c39cb5..baf4a1d 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -14,7 +14,7 @@ This document captures the architectural decisions for the project. It is a comp A strict separation between the game simulation and the Qt Widgets UI. -- The **simulation** is a pure C++ library that depends only on Qt Core (QPoint, QVector2D, QRect, etc., as required by the coding guidelines), toml++, and tinyexpr. It contains no QtWidgets, no painting, and no QApplication. +- The **simulation** is a pure C++ library that depends only on Qt Core and Qt Gui (QPoint, QVector2D, QRect, etc., as required by the coding guidelines), toml++, and tinyexpr. It contains no QtWidgets, no painting, and no QApplication. Note: in Qt 5, vector math types such as QVector2D live in Qt::Gui rather than Qt::Core, so the lib links both. - The **UI** reads simulation state and renders it. It owns all widgets, painting, and input handling, and drives the simulation via a small command interface (place building, demolish, clear belt tiles, change recipe, set game speed, etc.). This split is enforced at the CMake target level (see below). Tests link only against the simulation library and run without a display server. @@ -97,7 +97,7 @@ Within a single simulation tick, subsystems run in this fixed order. The order i Three product targets plus tests: -- `lib/` — simulation + config. Depends on Qt Core, toml++, tinyexpr. No QtWidgets. +- `lib/` — simulation + config. Depends on Qt Core + Qt Gui, toml++, tinyexpr. No QtWidgets. - `ui/` — QtWidgets + `QOpenGLWidget` code: header bar, game world view, selected building panel, build button grid. Depends on `lib` and on Qt's OpenGL widgets module. - `app/` — thin `main()` that creates the simulation, the UI, and wires them together. Depends on `ui`. - `tests/` — Catch2 tests. Links only against `lib`.