Example #1
0
        public MorroSystem(MorroFactory factory)
        {
            this.factory = factory;

            RequiredComponents    = new HashSet <Type>();
            BlacklistedComponents = new HashSet <Type>();
            Subscriptions         = new HashSet <Type>();
            Entities        = new HashSet <uint>();
            EntitiesAsArray = new uint[factory.EntityCapacity];
            entityRemoval   = new Queue <uint>((int)factory.EntityCapacity);
            entityAddition  = new Queue <uint>((int)factory.EntityCapacity);

            Enabled = true;
        }
Example #2
0
 /// <summary>
 /// Create a <see cref="MorroSystem"/> that will process or manipulate <see cref="IComponent"/> data on every frame or a fixed basis.
 /// </summary>
 /// <param name="factory">The factory this system will exist in.</param>
 public UpdateSystem(MorroFactory factory) : base(factory)
 {
     updateSystemHandler = new UpdateSystemHandler(this, UpdateEntity);
 }
Example #3
0
 /// <summary>
 /// Create a <see cref="MorroSystem"/> that will process <see cref="IComponent"/> data and preform draw logic every frame.
 /// </summary>
 /// <param name="factory">The factory this system will exist in.</param>
 public DrawSystem(MorroFactory factory) : base(factory)
 {
     drawSystemHandler = new DrawSystemHandler(this, DrawEntity);
 }
Example #4
0
 /// <summary>
 /// Create a <see cref="MorroSystem"/> that combines the functionality of an <see cref="UpdateSystem"/> and a <see cref="DrawSystem"/>.
 /// </summary>
 /// <param name="factory">The factory this system will exist in.</param>
 public HybridSystem(MorroFactory factory) : base(factory)
 {
     updateSystemHandler = new UpdateSystemHandler(this, UpdateEntity);
     drawSystemHandler   = new DrawSystemHandler(this, DrawEntity);
 }