Implement sprite index validation for Issue #33

Added validation to prevent setting sprite indices outside the valid
range for a texture. The implementation:
- Adds getSpriteCount() method to PyTexture to expose total sprites
- Validates sprite_number setter to ensure index is within bounds
- Provides clear error messages showing valid range
- Works for both Sprite and Entity objects

closes #33
This commit is contained in:
John McCardle 2025-07-03 21:09:06 -04:00
commit cb0130b46e
5 changed files with 153 additions and 2 deletions

View file

@ -200,8 +200,8 @@ Created comprehensive test suite with 13 tests covering all Python-exposed metho
8. ✅ Fix PyVector x/y properties - Were returning None
REMAINING IN PHASE 1:
9. Fix #73 - Entity.index() method for removal
10. Fix #27 - EntityCollection.extend() method
9. Fix #73 - Entity.index() method for removal
10. Fix #27 - EntityCollection.extend() method
11. Fix #33 - Sprite index validation
12. Alpha Blockers (#3, #2) - Remove deprecated methods
```