Files
trail-into-darkness/Assets/Code/GameState/Entities/CharacterAttributesFactory.cs
2026-03-22 14:46:19 +01:00

24 lines
833 B
C#

using System;
namespace Nox.Game {
public interface ICharacterAttributesFactory {
EntityAttributes Create(EntityAttributes attributes);
}
public sealed class CharacterAttributesFactory : ICharacterAttributesFactory {
private readonly CharacterRegistry characterRegistry;
public CharacterAttributesFactory(CharacterRegistry characterRegistry) {
this.characterRegistry = characterRegistry;
}
public EntityAttributes Create(EntityAttributes attributes) {
if(attributes.might <= 0 || attributes.reflex <= 0 || attributes.knowledge <= 0 || attributes.perception <= 0) {
throw new ArgumentOutOfRangeException( "attributes cannot be zero or negative.", new ArgumentException() );
}
return attributes;
}
}
}