removed dependency on Forge Attribute Set node
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 35s
Create tag and build when new code gets to main / Export (push) Successful in 7m50s

This commit is contained in:
2026-05-17 12:44:54 +02:00
parent 7746a40542
commit 3cdb7e85c3
9 changed files with 44 additions and 10 deletions

View File

@@ -1,12 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Gamesmiths.Forge.Attributes;
using Gamesmiths.Forge.Godot.Nodes;
using Godot;
using Godot.Collections;
using Movementtests.forge.attribute_sets;
using Movementtests.scenes.enemies;
using Movementtests.scenes.player_controller.components.weapon;
using Movementtests.scenes.player_controller.scripts;
namespace Movementtests.tools;
public static class ForgeUtils
{
public enum AttributeSetType
{
Meta,
Player,
Enemy,
Weapon,
Character
}
public static System.Collections.Generic.Dictionary<AttributeSetType, Func<AttributeSet>> AttributeSetMap { get; } = new()
{
{ AttributeSetType.Meta, () => new MetaAttributeSet() },
{ AttributeSetType.Player, () => new PlayerAttributeSet() },
{ AttributeSetType.Enemy, () => new EnemyAttributeSet() },
{ AttributeSetType.Weapon, () => new WeaponAttributeSet() },
{ AttributeSetType.Character, () => new CharacterAttributeSet() },
};
public static List<AttributeSet> CollectAttributeList(Node node)
{
List<AttributeSet> attributeSetList = [];
@@ -19,4 +44,9 @@ public static class ForgeUtils
}
return attributeSetList;
}
public static List<AttributeSet> CollectAttributeList(Array<AttributeSetType> types)
{
return types.Select(type => AttributeSetMap[type]()).ToList();
}
}