EntitySystem<T> class
This system is for keeping track of all created entities.
Constructors
Properties
-
deserializers
↔ List<
ComponentDeserializerFunction> -
A list of registered deserializer functions.
getter/setter pair
-
entities
→ BehaviorSubject<
List< Entity> > -
An observable list of entities.
final
- entityFromJsonFunction ↔ EntityFromJsonFunction
-
The function called to turn JSON into an entity;
getter/setter pair
- entityToJsonFunction ↔ EntityToJsonFunction
-
The function called to turn an entity into JSON.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serializers
↔ List<
ComponentSerializerFunction> -
A list of registered serializer functions.
getter/setter pair
-
uniqueKeyGeneratorFunction
↔ EntityUniqueKeyGeneratorFunction<
T> ? -
getter/setter pair
- uuid → Uuid
-
final
Methods
-
create(
) → Entity - The way a new entity should be created.
-
createFromJson(
Map< String, dynamic> json) → Entity - Deserializing entities from JSON.
-
destroyed(
Entity entity) → void - When an entity has been destroyed, we remove it from the list and that will automatically sync that to the observable list.
-
dispose(
) → void - Call this to release resources and workers.
-
entityToJson(
Entity entity) → Map< String, dynamic> - Standard serializer that turns an entity into JSON.
-
flush(
) → void - Remove all entities.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerDeserializer(
ComponentDeserializerFunction deserializer) → void - Register a deserializer function.
-
registerSerializer(
ComponentSerializerFunction serializer) → void - Register a serializer function.
-
setEntity(
Entity entity) → Entity - This function actually sets the entity in the list. Left public so that if you want to use your own method for creating entities you can, as long as you call this method so the system tracks the entity.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
withUniqueKeyGenerator<
T> (EntityUniqueKeyGeneratorFunction< T> uniqueKeyGeneratorFunction) → EntitySystem<T>