Add weapon database and equipment component resources with associated services
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user