forked from Shardstone/trail-into-darkness
added modfiers factory
This commit is contained in:
@@ -11,11 +11,23 @@ namespace Nox.Game {
|
||||
bool TryAddPerk(CharacterDefinition character, string perkId);
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class PerkDefinition {
|
||||
public string id;
|
||||
public string name;
|
||||
public ModifiersData modifiers = new ();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class PerksData {
|
||||
public List<PerkDefinition> perks = new ();
|
||||
}
|
||||
|
||||
public sealed class PerkFactory : IPerkFactory {
|
||||
private readonly Dictionary<string, PerkDefinition> perkPool = new ();
|
||||
|
||||
public PerkFactory(PerksRegistry perksRegistry) {
|
||||
if(perksRegistry == null) {
|
||||
if(!perksRegistry) {
|
||||
throw new ArgumentNullException(nameof(perksRegistry));
|
||||
}
|
||||
var allAvailablePerks = perksRegistry.perksData;
|
||||
|
||||
Reference in New Issue
Block a user