Ejemplo n.º 1
0
 public HierarchicalProcessor()
     : base(TransformComponent.Key)
 {
     rootEntities = new TrackingHashSet <Entity>();
     rootEntities.CollectionChanged += rootEntities_CollectionChanged;
     Order = -1000;
 }
Ejemplo n.º 2
0
        public EntitySystem(IServiceRegistry registry)
            : base(registry)
        {
            Services.AddService(typeof(EntitySystem), this);
            Enabled = true;
            Visible = true;

            entities        = new TrackingDictionary <Entity, List <EntityProcessor> >();
            enabledEntities = new TrackingHashSet <Entity>();

            processors = new TrackingHashSet <EntityProcessor>();
            processors.CollectionChanged += new EventHandler <TrackingCollectionChangedEventArgs>(systems_CollectionChanged);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EntityManager"/> class.
        /// </summary>
        /// <param name="registry">The registry.</param>
        /// <exception cref="System.ArgumentNullException">registry</exception>
        protected EntityManager(IServiceRegistry registry)
        {
            if (registry == null)
            {
                throw new ArgumentNullException("registry");
            }
            Services = registry;

            entities        = new TrackingDictionary <Entity, List <EntityProcessor> >();
            enabledEntities = new TrackingHashSet <Entity>();

            processors    = new FastCollection <EntityProcessor>();
            newProcessors = new List <EntityProcessor>();

            componentTypes = new HashSet <Type>();
            processorTypes = new HashSet <Type>();
        }
Ejemplo n.º 4
0
 public HierarchicalProcessor()
     : base(new[] { TransformationComponent.Key })
 {
     rootEntities = new TrackingHashSet <Entity>();
     rootEntities.CollectionChanged += rootEntities_CollectionChanged;
 }