Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing meta files #7

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Arch.SystemGroups/Descriptors.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Arch.SystemGroups/Descriptors/SystemDescriptor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Arch.SystemGroups/Descriptors/SystemGroupDescriptor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;

namespace Arch.SystemGroups.Descriptors;

namespace Arch.SystemGroups.Descriptors
{
/// <summary>
/// Descriptor for a SystemGroup
/// </summary>
Expand Down Expand Up @@ -35,3 +35,4 @@ public SystemGroupDescriptor(string name, IReadOnlyList<SystemDescriptor> system
/// </summary>
public IReadOnlyList<SystemGroupDescriptor> Groups { get; }
}
}
11 changes: 11 additions & 0 deletions Arch.SystemGroups/Descriptors/SystemGroupDescriptor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 49 additions & 48 deletions Arch.SystemGroups/Descriptors/SystemGroupWorldExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,64 +1,65 @@
using System.Collections.Generic;
using JetBrains.Annotations;

namespace Arch.SystemGroups.Descriptors;

/// <summary>
/// Extensions for SystemGroupWorld
/// </summary>
public static class SystemGroupWorldExtensions
namespace Arch.SystemGroups.Descriptors
{
/// <summary>
/// Generate the descriptor for the SystemGroupWorld
/// Extensions for SystemGroupWorld
/// </summary>
/// <param name="world"></param>
[UsedImplicitly]
public static IReadOnlyList<SystemGroupDescriptor> GenerateDescriptors(this SystemGroupWorld world)
public static class SystemGroupWorldExtensions
{
var descriptors = new List<SystemGroupDescriptor>();
// Foreach system group such as initialization, simulation, presentation
foreach (var worldSystemGroup in world.SystemGroups)
/// <summary>
/// Generate the descriptor for the SystemGroupWorld
/// </summary>
/// <param name="world"></param>
[UsedImplicitly]
public static IReadOnlyList<SystemGroupDescriptor> GenerateDescriptors(this SystemGroupWorld world)
{
descriptors.Add(GenerateGroupDescriptor(worldSystemGroup.GetType().Name, worldSystemGroup.Nodes));
}
var descriptors = new List<SystemGroupDescriptor>();
// Foreach system group such as initialization, simulation, presentation
foreach (var worldSystemGroup in world.SystemGroups)
{
descriptors.Add(GenerateGroupDescriptor(worldSystemGroup.GetType().Name, worldSystemGroup.Nodes));
}

return descriptors;
}
return descriptors;
}

/// <summary>
/// Generate the descriptor for the SystemGroup
/// </summary>
/// <param name="name">Name of the system group</param>
/// <param name="nodes">List of nodes within the system group</param>
private static SystemGroupDescriptor GenerateGroupDescriptor(string name, IReadOnlyList<ExecutionNode<float>> nodes)
{
var groupSystems = new List<SystemDescriptor>();
var groupNestedGroups = new List<SystemGroupDescriptor>();
GenerateNestedGroupDescriptors(nodes, groupSystems, groupNestedGroups);
return new SystemGroupDescriptor(name, groupSystems, groupNestedGroups
);
}
/// <summary>
/// Generate the descriptor for the SystemGroup
/// </summary>
/// <param name="name">Name of the system group</param>
/// <param name="nodes">List of nodes within the system group</param>
private static SystemGroupDescriptor GenerateGroupDescriptor(string name, IReadOnlyList<ExecutionNode<float>> nodes)
{
var groupSystems = new List<SystemDescriptor>();
var groupNestedGroups = new List<SystemGroupDescriptor>();
GenerateNestedGroupDescriptors(nodes, groupSystems, groupNestedGroups);
return new SystemGroupDescriptor(name, groupSystems, groupNestedGroups
);
}

/// <summary>
/// Generate the descriptor for the SystemGroupWorld
/// </summary>
/// <param name="nodes"></param>
/// <param name="groupSystems"></param>
/// <param name="groupNestedGroups"></param>
/// <returns></returns>
private static void GenerateNestedGroupDescriptors(IReadOnlyList<ExecutionNode<float>> nodes,
List<SystemDescriptor> groupSystems, List<SystemGroupDescriptor> groupNestedGroups)
{
if(nodes is null) return;
foreach (var node in nodes)
/// <summary>
/// Generate the descriptor for the SystemGroupWorld
/// </summary>
/// <param name="nodes"></param>
/// <param name="groupSystems"></param>
/// <param name="groupNestedGroups"></param>
/// <returns></returns>
private static void GenerateNestedGroupDescriptors(IReadOnlyList<ExecutionNode<float>> nodes,
List<SystemDescriptor> groupSystems, List<SystemGroupDescriptor> groupNestedGroups)
{
if (node.IsGroup)
{
groupNestedGroups.Add(GenerateGroupDescriptor(node.CustomGroup.GetType().Name, node.CustomGroup.Nodes));
}
else
if(nodes is null) return;
foreach (var node in nodes)
{
groupSystems.Add(new SystemDescriptor(node.System.GetType().Name, node.ThrottlingEnabled));
if (node.IsGroup)
{
groupNestedGroups.Add(GenerateGroupDescriptor(node.CustomGroup.GetType().Name, node.CustomGroup.Nodes));
}
else
{
groupSystems.Add(new SystemDescriptor(node.System.GetType().Name, node.ThrottlingEnabled));
}
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions Arch.SystemGroups/Descriptors/SystemGroupWorldExtensions.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.