Commit Graph

13 Commits

Author SHA1 Message Date
388d354e51 Use std::optional instead of sentinel values for absent data
Replace sentinel values that signalled "no value" with std::optional
across simulation, UI, and balancing code:

- BuildingId references: DeliverScrapBehavior::deliveryBay,
  Simulation::m_hqBuildingId, the return types of BuildingSystem::place
  and Simulation::tryPlaceBuilding (previously kInvalidBuildingId on
  failure), GameWorldView building/site-at-tile lookups and demolish
  hover, SelectedBuildingPanel::m_singleBuildingId.
- Command id fields: the five id-carrying commands now hold
  optional<BuildingId>; CommandSerializer and Simulation::apply updated.
  The serialized replay format is unchanged.
- Index sentinels: BlueprintPanel::m_activeIndex,
  BalancingWindow::m_inspectedArenaIndex, ArenaSimulation winnerTeam,
  and the moduleIndex grid cells in ShipLayoutDialog/ShipLayoutPreview.
  ShipLayoutDialog::m_activeModuleIndex was a tri-state, so it is
  modelled as bool m_removeMode + optional<int>.

Building/ConstructionSite id defaults keep kInvalidBuildingId (identity,
not an absent reference); entt::null and config -1 domain values are
left as-is.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7N59FsLA5e2kuVdqe4Uhc
2026-07-20 07:36:34 +02:00
d412c69f82 Prefix all getters with "get" 2026-07-19 21:17:38 +02:00
8c4fb78fc9 Allow creating blueprints from construction sites 2026-07-13 20:50:13 +02:00
d74ba5bfad Replay: deterministic record & playback (#4)
Add deterministic record/playback for a run.

Recording captures `(seed, config hash, ordered tick-tagged commands)` and re-simulates on playback — no state snapshots. `DotaFactory.exe --replay <file>` re-plays a recorded run view-only with manual speed/pause.

Reviewed-on: #4
Co-authored-by: Malte Langkabel <malte.langkabel@gmail.com>
Co-committed-by: Malte Langkabel <malte.langkabel@gmail.com>
2026-07-01 19:20:08 +00:00
e5017ab3c5 fix issue where construction sites could be placed outside of game world and add tests 2026-06-22 21:13:01 +02:00
aad094f842 allow to configure when which schematic gets unlockable 2026-06-10 21:09:03 +02:00
3e19e44f24 store ship module layout in shipyard blueprint 2026-06-04 21:48:45 +02:00
b57299fd2a rename EntityId to BuildingId 2026-05-23 07:53:56 +02:00
7e0104e9b8 fix config data paths 2026-04-29 21:32:32 +02:00
541b8fdaee implement storing recipes in blueprint 2026-04-27 12:58:44 +02:00
e5abc320a0 implement ignore non-buildable buildings for blueprints 2026-04-26 22:50:13 +02:00
7859b38d62 fix blueprint rotation bug 2026-04-26 22:36:49 +02:00
1e2135dc5b add blueprint tests 2026-04-26 22:19:46 +02:00