EntityMap_TKey_.md

March 19, 2022 · View on GitHub

DefaultEcs

DefaultEcs

EntityMap Class

Represents a collection of Entity mapped to a TKey component. Only one Entity can be associated with a given TKey.

public sealed class EntityMap<TKey> :
System.IDisposable

Type parameters

TKey

The type of the component used as key.

Inheritance System.Object 🡒 EntityMap

Implements System.IDisposable

Properties
KeysGets the keys contained in the EntityMap<TKey>.
this[TKey]Gets the Entity associated with the specified key.
WorldGets the World instance from which current DefaultEcs.IEntityContainer originate.
Methods
Complete()Clears current instance of its entities if it was created with some reactive filter (WhenAdded<T>(), WhenChanged<T>() or WhenRemoved<T>()).
Does nothing if it was created from a static filter.
This method need to be called after current instance content has been processed in a update cycle.
Contains(Entity)Determines whether the DefaultEcs.IEntityContainer contains a specific Entity.
ContainsKey(TKey)Determines whether the EntityMap<TKey> contains the specified key.
Dispose()Releases current EntityMap<TKey> of its subscriptions, stopping it to get modifications on the World's Entity.
TrimExcess()Resizes inner storage to exactly the number of Entity this DefaultEcs.IEntityContainer contains.
TryGetEntity(TKey, Entity)Gets the Entity associated with the specified key.
Events
EntityAddedOccurs when an Entity is added in the current DefaultEcs.IEntityContainer.
EntityRemovedOccurs when an Entity is removed from the current DefaultEcs.IEntityContainer.