Added a bunch of utilities and modfief the character data structue

This commit is contained in:
Sebastian Bularca
2026-03-29 18:31:03 +02:00
parent 4a9c00212a
commit ee97b2fec3
110 changed files with 6752 additions and 169 deletions

View File

@@ -1,8 +1,9 @@
using System;
using System.Linq;
namespace Nox.Game {
public interface ICharacterAttributesFactory {
EntityAttributes Create(EntityAttributes attributes);
EntityAttributes Create(EntityAttributes entityAttributes);
}
public sealed class CharacterAttributesFactory : ICharacterAttributesFactory {
@@ -12,12 +13,12 @@ namespace Nox.Game {
this.characterRegistry = characterRegistry;
}
public EntityAttributes Create(EntityAttributes attributes) {
if(attributes.might <= 0 || attributes.reflex <= 0 || attributes.knowledge <= 0 || attributes.perception <= 0) {
public EntityAttributes Create(EntityAttributes entityAttributes) {
if(entityAttributes.attributes.All(a => a.value != 0)) {
throw new ArgumentOutOfRangeException( "attributes cannot be zero or negative.", new ArgumentException() );
}
return attributes;
//TODO: Handle attributes modifiers and perks
return entityAttributes;
}
}
}