This release features more API improvements and changes (based on observed pyriak usage), and also improved package documentation.
API Updates
tagclass()
function removed- All
add()
methods (Entity
,StateManager
,SystemManager
,EntityManager
) raiseValueError
if the object has already been added- New
update()
method that retains original behavior ofadd()
: remove old object if not equal to new object
- New
- Added
__setitem__
method toEntity
andStateManager
that has the behavior ofupdate()
ComponentRemoved
andEventHandlerRemoved
events are posted beforeEntityRemoved
andSystemRemoved
instead of after- Raise a
ValueError
instead ofKeyError
in some places bind()
decorator will now raiseTypeError
instead ofValueError
when keys are given for an event type with no key function
Typing
- The component, state, and event handler event types are now generic in their component/state/event type (invariant).
- The generic callback return type of
Binding
is now covariant instead of invariant - Generic event type of
Binding
integrated into type of_event_type_
attribute (type
->type[_T]
) - Removed unneeded field annotation in
SystemManager
Internal
_EventHandler
call only accepts(space, event)
arguments instead of(*args, **kwargs)
_EventHandler
is now generic in its event type- Event handler events post after they are bound/unbound instead of before
- Removed redundant, unused type variables in top-level module
Other
- Rewrote
README.md
file:- More formal and useful, added many sections
- Provides a guide on basic usage
- Badges for important info
- Removed the TODO list
- Improved PyPI package details: added PyPI classifiers and keywords
- Added more mypy checks/rules
- Updated docstrings of various things