[Minor Feature] EntityCollection3D missing pop(), find(), extend() methods #243

Closed
opened 2026-02-06 02:55:54 +00:00 by john · 0 comments
Owner

Description

EntityCollection3D (accessed via viewport.entities) only implements append(). It is missing pop(), find(), and extend() methods that the 2D UICollection provides.

Reproduction

import mcrfpy
viewport = mcrfpy.Viewport3D(pos=(0,0), size=(100,100))
viewport.set_grid_size(16, 16)
entities = viewport.entities

entity = mcrfpy.Entity3D(pos=(5,5), scale=1.0)
entities.append(entity)

# These all fail:
hasattr(entities, 'pop')      # False
hasattr(entities, 'find')     # False
hasattr(entities, 'extend')   # False

Expected Behavior

EntityCollection3D should match UICollection's interface:

  • pop(index) - Remove and return entity at index
  • find(name) - Find entity by name
  • extend(iterable) - Append multiple entities

Impact

Cannot remove individual entities from the viewport without clearing all. Workaround: rebuild the collection.

Found during village integration demo development.

## Description `EntityCollection3D` (accessed via `viewport.entities`) only implements `append()`. It is missing `pop()`, `find()`, and `extend()` methods that the 2D `UICollection` provides. ## Reproduction ```python import mcrfpy viewport = mcrfpy.Viewport3D(pos=(0,0), size=(100,100)) viewport.set_grid_size(16, 16) entities = viewport.entities entity = mcrfpy.Entity3D(pos=(5,5), scale=1.0) entities.append(entity) # These all fail: hasattr(entities, 'pop') # False hasattr(entities, 'find') # False hasattr(entities, 'extend') # False ``` ## Expected Behavior `EntityCollection3D` should match `UICollection`'s interface: - `pop(index)` - Remove and return entity at index - `find(name)` - Find entity by name - `extend(iterable)` - Append multiple entities ## Impact Cannot remove individual entities from the viewport without clearing all. Workaround: rebuild the collection. Found during village integration demo development.
john closed this issue 2026-02-09 12:47:41 +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#243
No description provided.