No method to add layer to grid after initialization #187

Closed
opened 2026-01-06 02:31:26 +00:00 by john · 1 comment
Owner
  • Grid.layers should be a tuple, not a list. (I'm not prepared to support a custom Layer collection, and the list return type implies that it's a modifiable collection)
  • TileLayer and ColorLayer need a .grid attribute, which can be assigned to associate the layer to a Grid. Setting layer.grid to None will remove the layer. layer.grid = grid should raise RuntimeError if the size of the grid is not exactly the size of the layer.
* `Grid.layers` should be a tuple, not a list. (I'm not prepared to support a custom Layer collection, and the list return type implies that it's a modifiable collection) * `TileLayer` and `ColorLayer` need a `.grid` attribute, which can be assigned to associate the layer to a Grid. Setting `layer.grid` to None will remove the layer. `layer.grid = grid` should raise `RuntimeError` if the size of the grid is not exactly the size of the layer.
Author
Owner

WONTFIX - grid.add_layer(layer) and grid.remove_layer(layer) exist; the layer.grid method would be very convenient and consistent, but I'm not going to take on the engineering work for such little benefit at this time.

`WONTFIX` - `grid.add_layer(layer)` and `grid.remove_layer(layer)` exist; the `layer.grid` method would be very convenient and consistent, but I'm not going to take on the engineering work for such little benefit at this time.
john closed this issue 2026-01-06 03:20:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#187
No description provided.