forked from Shardstone/trail-into-darkness
Some renaming and added more settings
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Jovian.InspectorTools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Jovian.Utilities;
|
||||
|
||||
namespace Nox.Game {
|
||||
public interface IModfiersFactory {
|
||||
@@ -11,7 +11,7 @@ namespace Nox.Game {
|
||||
bool TryAddModifier(CharacterDefinition character, string modiferId);
|
||||
}
|
||||
|
||||
public enum ModifierRole {
|
||||
public enum ModifierOperation {
|
||||
None,
|
||||
Flat,
|
||||
Addition,
|
||||
@@ -21,10 +21,12 @@ namespace Nox.Game {
|
||||
|
||||
[Serializable]
|
||||
public sealed class ModifierDefinition {
|
||||
public System.Guid id = Guid.NewGuid();
|
||||
public string name;
|
||||
[ReadOnly]
|
||||
public Guid id = Guid.NewGuid();
|
||||
public StatType statType;
|
||||
public AttributeType attributeType;
|
||||
public ModifierRole role;
|
||||
public ModifierOperation operation;
|
||||
public float value;
|
||||
}
|
||||
|
||||
@@ -35,10 +37,14 @@ namespace Nox.Game {
|
||||
|
||||
public class ModifiersFactory : IModfiersFactory {
|
||||
private readonly ModifiersRegistry modifiersRegistry;
|
||||
private readonly Dictionary<string, ModifierDefinition> modifierPool = new ();
|
||||
private readonly Dictionary<Guid, ModifierDefinition> modifierPool = new ();
|
||||
|
||||
public ModifiersFactory(ModifiersRegistry modifiersRegistry) {
|
||||
this.modifiersRegistry = modifiersRegistry;
|
||||
var allAvailableModifiers = modifiersRegistry.modifiersData;
|
||||
foreach(var modifier in allAvailableModifiers.modifiers) {
|
||||
modifierPool.Add(modifier.id, modifier);
|
||||
}
|
||||
}
|
||||
|
||||
public IReadOnlyCollection<ModifierDefinition> GetAll() {
|
||||
|
||||
Reference in New Issue
Block a user