Skip to content

Commit

Permalink
Add unity package to SystemGroups so it can become a dependency of an…
Browse files Browse the repository at this point in the history
…other package and be more easily debugged
  • Loading branch information
m3taphysics committed Oct 26, 2023
1 parent aac53ea commit 7e32f14
Show file tree
Hide file tree
Showing 39 changed files with 1,606 additions and 1,524 deletions.
13 changes: 13 additions & 0 deletions Arch.SystemGroups/Arch.SystemGroups.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Arch.SystemGroups",
"references": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
487 changes: 246 additions & 241 deletions Arch.SystemGroups/Builder/ArchSystemsWorldBuilder.cs

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions Arch.SystemGroups/Builder/ArchSystemsWorldBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
namespace Arch.SystemGroups;

/// <summary>
/// Publicly available extensions for the ArchSystemsWorldBuilder
/// </summary>
public static class ArchSystemsWorldBuilderExtensions
namespace Arch.SystemGroups
{
/// <summary>
/// Inject a custom group into the world. It allows to create a group with custom parameters.
/// Publicly available extensions for the ArchSystemsWorldBuilder
/// </summary>
public static ref ArchSystemsWorldBuilder<T> InjectCustomGroup<T, TGroup>(ref this ArchSystemsWorldBuilder<T> builder, TGroup group) where TGroup : CustomGroupBase<float>
public static class ArchSystemsWorldBuilderExtensions
{
builder.AddCustomGroup(group);
return ref builder;
/// <summary>
/// Inject a custom group into the world. It allows to create a group with custom parameters.
/// </summary>
public static ref ArchSystemsWorldBuilder<T> InjectCustomGroup<T, TGroup>(ref this ArchSystemsWorldBuilder<T> builder, TGroup group) where TGroup : CustomGroupBase<float>
{
builder.AddCustomGroup(group);
return ref builder;
}
}
}
27 changes: 14 additions & 13 deletions Arch.SystemGroups/DefaultSystemGroups/InitializationSystemGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
using Arch.SystemGroups.UnityBridge;
using JetBrains.Annotations;

namespace Arch.SystemGroups.DefaultSystemGroups;

/// <summary>
/// Updates at the end of the Initialization phase of the player loop
/// </summary>
public class InitializationSystemGroup : SystemGroup
namespace Arch.SystemGroups.DefaultSystemGroups
{
internal InitializationSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler, [CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
/// <summary>
/// Updates at the end of the Initialization phase of the player loop
/// </summary>
public class InitializationSystemGroup : SystemGroup
{
}
internal InitializationSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler, [CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
{
}

internal static readonly InitializationSystemGroup Empty = new (null, null, null);
internal static readonly InitializationSystemGroup Empty = new (null, null, null);

public override void Update()
{
Update(TimeProvider.GetInfo());
}
public override void Update()
{
Update(TimeProvider.GetInfo());
}


}
}
27 changes: 14 additions & 13 deletions Arch.SystemGroups/DefaultSystemGroups/PhysicsSystemGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
using Arch.SystemGroups.UnityBridge;
using JetBrains.Annotations;

namespace Arch.SystemGroups.DefaultSystemGroups;

/// <summary>
/// Updates at the beginning of the FixedUpdate phase of the player loop
/// before all fixed updates
/// </summary>
public class PhysicsSystemGroup : SystemGroup
namespace Arch.SystemGroups.DefaultSystemGroups
{
internal PhysicsSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler, [CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
/// <summary>
/// Updates at the beginning of the FixedUpdate phase of the player loop
/// before all fixed updates
/// </summary>
public class PhysicsSystemGroup : SystemGroup
{
}
internal PhysicsSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler, [CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
{
}

internal static readonly PhysicsSystemGroup Empty = new (null, null, null);
internal static readonly PhysicsSystemGroup Empty = new (null, null, null);

public override void Update()
{
Update(TimeProvider.GetFixedInfo());
public override void Update()
{
Update(TimeProvider.GetFixedInfo());
}
}
}
27 changes: 14 additions & 13 deletions Arch.SystemGroups/DefaultSystemGroups/PostPhysicsSystemGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
using Arch.SystemGroups.UnityBridge;
using JetBrains.Annotations;

namespace Arch.SystemGroups.DefaultSystemGroups;

/// <summary>
/// Updates at the end of the FixedUpdate phase of the player loop
/// </summary>
public class PostPhysicsSystemGroup : SystemGroup
namespace Arch.SystemGroups.DefaultSystemGroups
{
internal PostPhysicsSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
/// <summary>
/// Updates at the end of the FixedUpdate phase of the player loop
/// </summary>
public class PostPhysicsSystemGroup : SystemGroup
{
}
internal PostPhysicsSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
{
}

internal static readonly PostPhysicsSystemGroup Empty = new(null, null, null);
internal static readonly PostPhysicsSystemGroup Empty = new(null, null, null);

public override void Update()
{
Update(TimeProvider.GetFixedInfo());
public override void Update()
{
Update(TimeProvider.GetFixedInfo());
}
}
}
27 changes: 14 additions & 13 deletions Arch.SystemGroups/DefaultSystemGroups/PostRenderingSystemGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
using Arch.SystemGroups.UnityBridge;
using JetBrains.Annotations;

namespace Arch.SystemGroups.DefaultSystemGroups;

/// <summary>
/// Updates at the end of the PostLateUpdate phase of the player loop.
/// </summary>
public class PostRenderingSystemGroup : SystemGroup
namespace Arch.SystemGroups.DefaultSystemGroups
{
internal PostRenderingSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
/// <summary>
/// Updates at the end of the PostLateUpdate phase of the player loop.
/// </summary>
public class PostRenderingSystemGroup : SystemGroup
{
}
internal PostRenderingSystemGroup(List<ExecutionNode<float>> nodes, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(nodes, throttler, exceptionHandler)
{
}

internal static readonly PostRenderingSystemGroup Empty = new (null, null, null);
internal static readonly PostRenderingSystemGroup Empty = new (null, null, null);

public override void Update()
{
Update(TimeProvider.GetInfo());
public override void Update()
{
Update(TimeProvider.GetInfo());
}
}
}
27 changes: 14 additions & 13 deletions Arch.SystemGroups/DefaultSystemGroups/PresentationSystemGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@
using Arch.SystemGroups.UnityBridge;
using JetBrains.Annotations;

namespace Arch.SystemGroups.DefaultSystemGroups;

/// <summary>
/// Updates at the end of the PreLateUpdate phase of the player loop.
/// </summary>
public class PresentationSystemGroup : SystemGroup
namespace Arch.SystemGroups.DefaultSystemGroups
{
internal PresentationSystemGroup(List<ExecutionNode<float>> systems, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(systems, throttler, exceptionHandler)
/// <summary>
/// Updates at the end of the PreLateUpdate phase of the player loop.
/// </summary>
public class PresentationSystemGroup : SystemGroup
{
}
internal PresentationSystemGroup(List<ExecutionNode<float>> systems, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(systems, throttler, exceptionHandler)
{
}

internal static readonly PresentationSystemGroup Empty = new (null, null, null);
internal static readonly PresentationSystemGroup Empty = new (null, null, null);

public override void Update()
{
Update(TimeProvider.GetInfo());
public override void Update()
{
Update(TimeProvider.GetInfo());
}
}
}
27 changes: 14 additions & 13 deletions Arch.SystemGroups/DefaultSystemGroups/SimulationSystemGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
using Arch.SystemGroups.UnityBridge;
using JetBrains.Annotations;

namespace Arch.SystemGroups.DefaultSystemGroups;

/// <summary>
/// Updates at the end of the Update phase of the player loop
/// </summary>
public class SimulationSystemGroup : SystemGroup
namespace Arch.SystemGroups.DefaultSystemGroups
{
internal SimulationSystemGroup(List<ExecutionNode<float>> systems, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(systems, throttler, exceptionHandler)
/// <summary>
/// Updates at the end of the Update phase of the player loop
/// </summary>
public class SimulationSystemGroup : SystemGroup
{
}
internal SimulationSystemGroup(List<ExecutionNode<float>> systems, [CanBeNull] ISystemGroupThrottler throttler,
[CanBeNull] ISystemGroupExceptionHandler exceptionHandler) : base(systems, throttler, exceptionHandler)
{
}

internal static readonly SimulationSystemGroup Empty = new (null, null, null);
internal static readonly SimulationSystemGroup Empty = new (null, null, null);

public override void Update()
{
Update(TimeProvider.GetInfo());
public override void Update()
{
Update(TimeProvider.GetInfo());
}
}
}
29 changes: 15 additions & 14 deletions Arch.SystemGroups/DefaultSystemGroups/SystemGroupsUtils.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
namespace Arch.SystemGroups.DefaultSystemGroups;

/// <summary>
/// System Groups Utility Functions
/// </summary>
public static class SystemGroupsUtils
namespace Arch.SystemGroups.DefaultSystemGroups
{
/// <summary>
/// The number of defined system groups:
/// <see cref="InitializationSystemGroup" />
/// <see cref="PhysicsSystemGroup" />
/// <see cref="PresentationSystemGroup" />
/// <see cref="SimulationSystemGroup" />
/// <see cref="PostPhysicsSystemGroup" />
/// <see cref="PostRenderingSystemGroup" />
/// System Groups Utility Functions
/// </summary>
public const int Count = 6;
public static class SystemGroupsUtils
{
/// <summary>
/// The number of defined system groups:
/// <see cref="InitializationSystemGroup" />
/// <see cref="PhysicsSystemGroup" />
/// <see cref="PresentationSystemGroup" />
/// <see cref="SimulationSystemGroup" />
/// <see cref="PostPhysicsSystemGroup" />
/// <see cref="PostRenderingSystemGroup" />
/// </summary>
public const int Count = 6;
}
}
Loading

0 comments on commit 7e32f14

Please sign in to comment.