Beispiel #1
0
 public ComponentStorage(IEqualityComparer <TComponentKind> componentKindEqualityComparer, IEqualityComparer <TEntityId> entityEqualityComparer, ComponentKindRegistry <TComponentKind> componentKindRegistry, EntityComponentEventDispatcher <TEntityId, TComponentKind> entityComponentEventDispatcher)
 {
     _componentKindComparer          = new ProxyComparer <TComponentKind>(componentKindEqualityComparer);
     _componentsByEntity             = new Dictionary <TEntityId, CompactDictionary <TComponentKind, ComponentId> >(entityEqualityComparer);
     _componentKindRegistry          = componentKindRegistry;
     _entityComponentEventDispatcher = entityComponentEventDispatcher;
 }
Beispiel #2
0
 public void SubscribeTo(EntityComponentEventDispatcher <TEntityId, TComponentKind> entityComponentEventDispatcher)
 {
     entityComponentEventDispatcher.AddedComponents   += OnAddedComponents;
     entityComponentEventDispatcher.RemovedComponents += OnRemovedComponents;
 }