Add weapon database and equipment component resources with associated services

This commit is contained in:
2025-10-29 01:26:45 +01:00
parent 87169b17ae
commit 626f81cd85
16 changed files with 245 additions and 11 deletions

View File

@@ -18,10 +18,12 @@ namespace CryptonymThunder.Code.Factories;
public class ComponentFactory
{
private readonly Dictionary<Type, Func<Resource, IComponent>> _factories = new();
private readonly EffectFactory _effectFactory = new();
private readonly EffectFactory _effectFactory;
public ComponentFactory()
public ComponentFactory(EffectFactory effectFactory)
{
_effectFactory = effectFactory;
Register<AttributeComponentResource>(CreateAttributeComponent);
Register<WeaponComponentResource>(CreateWeaponComponent);
Register<ProjectileComponentResource>(CreateProjectileComponent);
@@ -33,6 +35,7 @@ public class ComponentFactory
Register<CharacterStateComponentResource>(_ => new CharacterStateComponent());
Register<InventoryComponentResource>(_ => new InventoryComponent());
Register<PickupComponentResource>(CreatePickupComponent);
Register<EquipmentComponentResource>(_ => new EquipmentComponent());
}
public IComponent Create(Resource resource)