示例#1
0
        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);
        }
示例#2
0
        public int GetEntityCount(BaseSystem system)
        {
            SystemWrapper wrapper;

            wrappers.TryGetValue(system.GetType(), out wrapper);
            if (wrapper != null)
            {
                return(wrapper.EntityCount);
            }
            return(0);
        }