示例#1
0
 /// <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)
 {
 }
示例#2
0
 /// <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)));
 }
示例#3
0
 /// <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;
 }
示例#4
0
 /// <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> >)
 {
 }
示例#5
0
 /// <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)
 {
 }
示例#6
0
 /// <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> >)
 {
 }
示例#7
0
 /// <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();
 }