Files
trail-into-darkness/Assets/Code/GameState/Entities/CharacterAttributesFactory.cs
Sebastian Bularca e7d5acac7c Moar refactoring
2026-03-30 01:06:02 +02:00

25 lines
871 B
C#

using System;
using System.Linq;
namespace Nox.Game {
public interface ICharacterAttributesFactory {
EntityAttributes Create(EntityAttributes entityAttributes);
}
public sealed class CharacterAttributesFactory : ICharacterAttributesFactory {
private readonly CharacterRegistry characterRegistry;
public CharacterAttributesFactory(CharacterRegistry characterRegistry) {
this.characterRegistry = characterRegistry;
}
public EntityAttributes Create(EntityAttributes entityAttributes) {
if(entityAttributes.attributes.Any(a => a.value <= 0)) {
throw new ArgumentOutOfRangeException( "attributes cannot be zero or negative.", new ArgumentException() );
}
//TODO: Handle attributes modifiers and perks
return entityAttributes;
}
}
}