Dart Documentationsystem_entity_stateEntityState

EntityState class

class EntityState {
 final _componentProviderByType = new Bag<ComponentProvider>();
 final _indicesP = new Set<int>();

 final modifiers = new List<ComponentModifier>();

 void add(ComponentProvider provider) {
   int index = provider.type.id;
   _componentProviderByType[index] = provider;
   _indicesP.add(index);
 }

 void forEach(void f(ComponentProvider)) {
   _indicesP.forEach((index) => f(_componentProviderByType[index]));
 }

 ComponentProvider getByType(ComponentType type) => _componentProviderByType[type.id];

}

Properties

final modifiers #

final modifiers = new List<ComponentModifier>()

Methods

void add(ComponentProvider provider) #

void add(ComponentProvider provider) {
 int index = provider.type.id;
 _componentProviderByType[index] = provider;
 _indicesP.add(index);
}

void forEach(void f(ComponentProvider)) #

void forEach(void f(ComponentProvider)) {
 _indicesP.forEach((index) => f(_componentProviderByType[index]));
}

ComponentProvider getByType(ComponentType type) #

ComponentProvider getByType(ComponentType type) => _componentProviderByType[type.id];