Add initial resource and presenter classes for game entities and effects

This commit is contained in:
2025-10-13 12:11:50 +02:00
commit ad3e631d8c
75 changed files with 1423 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using System;
using System.Runtime.InteropServices.ComTypes;
using CryptonymThunder.Code.Resources;
using CryptonymThunder.Code.Resources.Effects;
using GameCore.Combat.Effects;
using GameCore.Combat.Interfaces;
namespace CryptonymThunder.Code.Factories;
public class EffectFactory
{
public IEffect Create(EffectResource resource)
{
return resource switch
{
FireProjectileEffectResource fire =>
new BulkProjectileEffect(fire.ProjectileArchetypeId, fire.Count, fire.SpreadAngle, fire.ProjectileSpeed),
DamageEffectResource damage => new DamageEffect(damage.Amount),
HitscanEffectResource hitscan => new HitscanEffect(hitscan.Range),
_ => throw new ArgumentOutOfRangeException(nameof(resource),
$"Effect type {resource.GetType().Name} not recognized")
};
}
}