UIGrid: replace vector member getter/setters #20

Closed
opened 2024-03-09 18:54:41 +00:00 by john · 2 comments
Owner

Notes say:
25 refactor: UIGrid get_grid_size replaced with standardized vector methods [depend on feat: standardize vector handling]

Notes say: 25 refactor: UIGrid get_grid_size replaced with standardized vector methods \[depend on feat: standardize vector handling]
john added the
Minor Feature
label 2024-03-09 18:54:50 +00:00
john added this to the All Datatypes Behaving milestone 2024-03-13 13:03:22 +00:00
john added this to the The Datatype Overhaul project 2024-03-13 13:06:39 +00:00
john removed this from the The Datatype Overhaul project 2024-03-13 13:12:16 +00:00
john added this to the Fun, Convenient McRogueFace Objects project 2024-03-13 14:37:03 +00:00
john added the
priority:tier2-foundation
system:grid
labels 2025-10-26 00:49:50 +00:00
Author
Owner

Status: Partially addressed, no longer actionable

  • grid_size exists as read-only property returning (grid_x, grid_y) tuple (src/UIGrid.cpp:810-812, 1462)
  • grid_x and grid_y also available as read-only properties
  • No setter is appropriate - resizing a grid would invalidate:
    • The TCOD map
    • All entity gridstate vectors
    • The points vector
    • The render texture

The original note mentioned "depend on feat: standardize vector handling" - the current tuple-based getter IS the standardized approach.

Status: Partially addressed, no longer actionable - grid_size exists as read-only property returning (grid_x, grid_y) tuple (src/UIGrid.cpp:810-812, 1462) - grid_x and grid_y also available as read-only properties - No setter is appropriate - resizing a grid would invalidate: - The TCOD map - All entity gridstate vectors - The points vector - The render texture The original note mentioned "depend on feat: standardize vector handling" - the current tuple-based getter IS the standardized approach.
john closed this issue 2025-11-26 10:12:12 +00:00
Author
Owner

Complete - Read-Only is Correct

The grid_size property exists as a read-only getter returning (grid_x, grid_y) tuple.

Current API

grid.grid_size  # Returns (grid_x, grid_y) tuple
grid.grid_x     # Individual dimension
grid.grid_y     # Individual dimension

A setter is intentionally not provided because resizing a grid would invalidate:

  • The TCOD map for FOV/pathfinding
  • All entity gridstate vectors
  • The internal points vector
  • The render texture

If grid resizing is needed, the correct approach is to create a new grid. The original note mentioned "depend on feat: standardize vector handling" - the current tuple-based getter IS the standardized approach used throughout the codebase.

## Complete - Read-Only is Correct The `grid_size` property exists as a read-only getter returning `(grid_x, grid_y)` tuple. ### Current API ```python grid.grid_size # Returns (grid_x, grid_y) tuple grid.grid_x # Individual dimension grid.grid_y # Individual dimension ``` A **setter is intentionally not provided** because resizing a grid would invalidate: - The TCOD map for FOV/pathfinding - All entity gridstate vectors - The internal points vector - The render texture If grid resizing is needed, the correct approach is to create a new grid. The original note mentioned "depend on feat: standardize vector handling" - the current tuple-based getter IS the standardized approach used throughout the codebase.
Sign in to join this conversation.
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: john/McRogueFace#20
No description provided.