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; }
/// <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); }
/// <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); }
/// <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); }