McRogueFace/docs
John McCardle f797120d53 Replace UIEntity gridstate with DiscreteMap perspective_map; closes #294
Per-entity FOV memory moves from std::vector<UIGridPointState> (two-bool
visible/discovered pairs) to a 3-state DiscreteMap (0=UNKNOWN, 1=DISCOVERED,
2=VISIBLE), exposed as entity.perspective_map. The invariant
visible-subset-of-discovered becomes structural (single value per cell), and
the map is a live, serializable, first-class object rather than an implicit
internal array.

Changes:
- New DiscreteMap C++ class with shared ownership; PyDiscreteMapObject now
  holds shared_ptr<DiscreteMap>. UIEntity holds the same shared_ptr.
- New mcrfpy.Perspective IntEnum (UNKNOWN/DISCOVERED/VISIBLE), modelled on
  PyInputState.
- entity.perspective_map: lazy-allocated on first access with a grid;
  setter validates size against grid and raises ValueError on mismatch;
  None clears (next access lazy-reallocates fresh).
- updateVisibility() now demotes 2->1 then promotes visible cells to 2.
- entity.at(x, y) returns grid.at(x, y) when VISIBLE, else None.
- Fog-of-war rendering in UIGridView and UIGrid reads the 3-state map.
- Removed: UIEntity::gridstate, ensureGridstate(), entity.gridstate getter,
  UIGridPointState struct + PyUIGridPointStateType.
- Obsolete tests deleted (test_gridpointstate_point,
  issue_265_gridpointstate_dangle); 4 new tests cover lazy allocation,
  identity, serialization round-trip, size validation, and the
  visible-subset-of-discovered invariant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 23:04:27 -04:00
..
cookbook Cookbook: draft docs 2026-01-13 19:42:37 -05:00
stubs Fix #161: Update Grid, GridPoint, GridPointState stubs to match current API 2026-01-21 21:47:26 -05:00
templates draft tutorial revisions 2026-01-03 11:01:10 -05:00
tutorials Update all 13 tutorial scripts to current enum-based API, refs #167 2026-04-09 23:23:35 -04:00
api-audit-2026-04.md Fix audit type count (44->46) and add regression test for Color __eq__, refs #307 2026-04-09 21:45:12 -04:00
api_reference_complete.html docs: Add complete API reference documentation 2025-10-23 13:19:36 -04:00
API_REFERENCE_COMPLETE.md Squashed commit of the following: [alpha_presentable] 2025-07-15 21:30:49 -04:00
api_reference_dynamic.html Replace UIEntity gridstate with DiscreteMap perspective_map; closes #294 2026-04-17 23:04:27 -04:00
API_REFERENCE_DYNAMIC.md Replace UIEntity gridstate with DiscreteMap perspective_map; closes #294 2026-04-17 23:04:27 -04:00
EMSCRIPTEN_RESEARCH.md First successful Emscripten/WASM build for #158 2026-01-31 00:34:11 -05:00
ISSUE_TRIAGE_2026-04.md Add issue triage document for all 46 open issues 2026-04-10 00:37:20 -04:00
mcrfpy.3 Replace UIEntity gridstate with DiscreteMap perspective_map; closes #294 2026-04-17 23:04:27 -04:00
PROCEDURAL_GENERATION_SPEC.md HeightMap: core class with scalar operations (closes #193) 2026-01-11 20:07:55 -05:00
WASM_TROUBLESHOOTING.md Add WASM developer troubleshooting guide, closes #240 2026-04-10 03:31:43 -04:00