1. Michael Ludwig
  2. entreri
  3. Issues
Issue #46 resolved

Add an as(Class) and a has(Class) method to Entity

Michael Ludwig
repo owner created an issue

as(Class) will vivify the component type if it's not present. This will be useful for tasks that require a specific set of components and don't want to check and add if necessary.

has(Class) is a convenience for checking the existence of a type, without getting it and checking against null. Performance should be about the same but I think both of these methods allow for greater readability.