forked from Shardstone/trail-into-darkness
factored the character system - not funtional yet
This commit is contained in:
37
Assets/Code/GameState/Entities/CharacterStatsFactory.cs
Normal file
37
Assets/Code/GameState/Entities/CharacterStatsFactory.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace Nox.Game {
|
||||
public interface ICharacterStatsFactory {
|
||||
EntityStats Create(EntityAttributes attributes);
|
||||
}
|
||||
|
||||
public sealed class CharacterStatsFactoryOptions {
|
||||
public EntityStats entityStats = new EntityStats() {
|
||||
health = 10,
|
||||
stamina = 10,
|
||||
level = 1,
|
||||
experience = 0
|
||||
};
|
||||
}
|
||||
|
||||
public sealed class CharacterStatsFactory : ICharacterStatsFactory {
|
||||
private readonly CharacterStatsFactoryOptions options;
|
||||
|
||||
public CharacterStatsFactory(CharacterStatsFactoryOptions options = null) {
|
||||
this.options = options ?? new CharacterStatsFactoryOptions();
|
||||
}
|
||||
|
||||
public EntityStats Create(EntityAttributes attributes) {
|
||||
if(attributes == null) {
|
||||
throw new ArgumentNullException(nameof(attributes));
|
||||
}
|
||||
|
||||
// int maxHealth = options.baseHealth + attributes.might * options.mightHealthBonus;
|
||||
// int maxStamina = options.baseStamina +
|
||||
// attributes.might * options.mightStaminaBonus +
|
||||
// attributes.knowledge * options.knowledgeStaminaBonus;
|
||||
|
||||
return new EntityStats { };
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user