new forge entity node to benefit from autoinject

This commit is contained in:
2026-05-02 15:24:28 +02:00
parent fb30a08b89
commit 0e6211943d
12 changed files with 134 additions and 99 deletions

22
tools/ForgeUtils.cs Normal file
View File

@@ -0,0 +1,22 @@
using System.Collections.Generic;
using Gamesmiths.Forge.Attributes;
using Gamesmiths.Forge.Godot.Nodes;
using Godot;
namespace Movementtests.tools;
public static class ForgeUtils
{
public static List<AttributeSet> CollectAttributeList(Node node)
{
List<AttributeSet> attributeSetList = [];
foreach (var child in node.GetChildren())
{
if (child is not ForgeAttributeSet attributeSetNode) continue;
var attributeSet = attributeSetNode.GetAttributeSet();
if (attributeSet is not null)
attributeSetList.Add(attributeSet);
}
return attributeSetList;
}
}