Implement EntityCollection.extend() method for Issue #27

Added extend() method to EntityCollection that accepts any iterable
of Entity objects and adds them all to the collection. The method:
- Accepts lists, tuples, generators, or any iterable
- Validates all items are Entity objects
- Sets the grid association for each added entity
- Properly handles errors and empty iterables

closes #27
This commit is contained in:
John McCardle 2025-07-03 21:05:47 -04:00
commit 1e7f5e9e7e
4 changed files with 165 additions and 1 deletions

View file

@ -77,6 +77,7 @@ class UIEntityCollection {
public:
static PySequenceMethods sqmethods;
static PyObject* append(PyUIEntityCollectionObject* self, PyObject* o);
static PyObject* extend(PyUIEntityCollectionObject* self, PyObject* o);
static PyObject* remove(PyUIEntityCollectionObject* self, PyObject* o);
static PyMethodDef methods[];
static PyObject* repr(PyUIEntityCollectionObject* self);