removed dependency on Forge Attribute Set node
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user