factored the character system - not funtional yet

This commit is contained in:
Sebastian Bularca
2026-03-22 14:46:19 +01:00
parent 00bb430a7f
commit 0f0189726e
36 changed files with 639 additions and 513 deletions

View File

@@ -0,0 +1,23 @@
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;
}
}
}