public bool Add(BaseSystem system, IEnumerable <IEntity> existingEntities) { if (wrappers.ContainsKey(system.GetType())) { return(false); } SystemWrapper wrapper = new SystemWrapper(system); wrappers.Add(system.GetType(), wrapper); foreach (Entity enitity in existingEntities) { wrapper.AddEntity(enitity); } return(true); }
public int GetEntityCount(BaseSystem system) { SystemWrapper wrapper; wrappers.TryGetValue(system.GetType(), out wrapper); if (wrapper != null) { return(wrapper.EntityCount); } return(0); }