/// <summary> /// Initialises a new instance of the <see cref="ParallelSystem{T}"/> class. /// </summary> /// <param name="runner">The <see cref="SystemRunner{T}"/> used to process the update in parallel if not null.</param> /// <param name="systems">The <see cref="ISystem{T}"/> instances.</param> public ParallelSystem(SystemRunner <T> runner, params ISystem <T>[] systems) : this(null, runner, systems) { }
/// <summary> /// Initialise a new instance of the <see cref="AComponentSystem{TState, TComponent}"/> class with the given <see cref="World"/> and <see cref="SystemRunner{TState}"/>. /// </summary> /// <param name="world">The <see cref="World"/> on which to process the update.</param> /// <param name="runner">The <see cref="SystemRunner{T}"/> used to process the update in parallel if not null.</param> /// <exception cref="ArgumentNullException"><paramref name="world"/> is null.</exception> protected AComponentSystem(World world, SystemRunner <TState> runner) : base(runner) { _component = ComponentManager <TComponent> .GetOrCreate(world?.WorldId ?? throw new ArgumentNullException(nameof(world))); }
/// <summary> /// Initialises a new instance of the <see cref="ParallelSystem{T}"/> class. /// </summary> /// <param name="mainSystem">The <see cref="ISystem{T}"/> instance to be updated on the calling thread.</param> /// <param name="runner">The <see cref="SystemRunner{T}"/> used to process the update in parallel if not null.</param> /// <param name="systems">The <see cref="ISystem{T}"/> instances.</param> public ParallelSystem(ISystem <T> mainSystem, SystemRunner <T> runner, params ISystem <T>[] systems) : base(runner) { _mainSystem = mainSystem; _systems = systems ?? EmptyArray <ISystem <T> > .Value; }
/// <summary> /// Initialises a new instance of the <see cref="ParallelSystem{T}"/> class. /// </summary> /// <param name="runner">The <see cref="SystemRunner{T}"/> used to process the update in parallel if not null.</param> /// <param name="systems">The <see cref="ISystem{T}"/> instances.</param> public ParallelSystem(SystemRunner <T> runner, params ISystem <T>[] systems) : this(null, runner, systems as IEnumerable <ISystem <T> >) { }
/// <summary> /// Initialises a new instance of the <see cref="ParallelSystem{T}"/> class. /// </summary> /// <param name="runner">The <see cref="SystemRunner{T}"/> used to process the update in parallel if not null.</param> /// <param name="systems">The <see cref="ISystem{T}"/> instances.</param> public ParallelSystem(SystemRunner <T> runner, IEnumerable <ISystem <T> > systems) : this(null, runner, systems) { }
/// <summary> /// Initialises a new instance of the <see cref="ParallelSystem{T}"/> class. /// </summary> /// <param name="mainSystem">The <see cref="ISystem{T}"/> instance to be updated on the calling thread.</param> /// <param name="runner">The <see cref="SystemRunner{T}"/> used to process the update in parallel if not null.</param> /// <param name="systems">The <see cref="ISystem{T}"/> instances.</param> public ParallelSystem(ISystem <T> mainSystem, SystemRunner <T> runner, params ISystem <T>[] systems) : this(mainSystem, runner, systems as IEnumerable <ISystem <T> >) { }
/// <summary> /// Initialises a new instance of the <see cref="ParallelSystem{T}"/> class. /// </summary> /// <param name="mainSystem">The <see cref="ISystem{T}"/> instance to be updated on the calling thread.</param> /// <param name="runner">The <see cref="SystemRunner{T}"/> used to process the update in parallel if not null.</param> /// <param name="systems">The <see cref="ISystem{T}"/> instances.</param> public ParallelSystem(ISystem <T> mainSystem, SystemRunner <T> runner, IEnumerable <ISystem <T> > systems) : base(runner) { _mainSystem = mainSystem; _systems = (systems ?? Enumerable.Empty <ISystem <T> >()).Where(s => s != null).ToArray(); }