Example #1
0
 public void UpdateEntityValidity(Entity entity)
 {
     if (entities.Contains(entity)) {
         if (!entity.ContainsAll(System.KeyComponents)) {
             RemoveEntity(entity);
         }
     }
     else {
         if (entity.ContainsAll(System.KeyComponents)) {
             AddEntity(entity);
         }
     }
 }
Example #2
0
 public void AddEntity(Entity entity)
 {
     if (!entity.ContainsAll(System.KeyComponents)) {
         //entity does not have the right components
         return;
     }
     if (entities.Contains(entity)) {
         //system already contains the entity.
         return;
     }
     entities.Add(entity);
     System.EntityAdded(entity);
 }