From f45a2a8bbd14abf3360d91863571f348a100702f Mon Sep 17 00:00:00 2001 From: LP Date: Mon, 20 Jun 2022 21:27:05 +0100 Subject: [PATCH] Removed computed notion Realised all of this can be expressed via effects --- appveyor.yml | 2 +- src/OpenRpg.Core/Stats/IHasStats.cs | 1 - .../Variables/DefaultComputedStatsVariabless.cs | 13 ------------- .../Stats/Variables/IComputedStatsVariables.cs | 7 ------- src/OpenRpg.Core/Stats/Variables/IStatPopulator.cs | 4 ++-- src/OpenRpg.Core/Types/CoreVariableTypes.cs | 3 --- .../Computed/IComputedVariablePopulator.cs | 10 ---------- .../Variables/Computed/IComputedVariables.cs | 11 ----------- src/OpenRpg.Core/Variables/IVariablePopulator.cs | 10 ++++++++++ 9 files changed, 13 insertions(+), 48 deletions(-) delete mode 100644 src/OpenRpg.Core/Stats/Variables/DefaultComputedStatsVariabless.cs delete mode 100644 src/OpenRpg.Core/Stats/Variables/IComputedStatsVariables.cs delete mode 100644 src/OpenRpg.Core/Variables/Computed/IComputedVariablePopulator.cs delete mode 100644 src/OpenRpg.Core/Variables/Computed/IComputedVariables.cs create mode 100644 src/OpenRpg.Core/Variables/IVariablePopulator.cs diff --git a/appveyor.yml b/appveyor.yml index 831029c..a58a2b0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.22.{build} +version: 0.23.{build} branches: only: - master diff --git a/src/OpenRpg.Core/Stats/IHasStats.cs b/src/OpenRpg.Core/Stats/IHasStats.cs index 0828f54..2fc1ffa 100644 --- a/src/OpenRpg.Core/Stats/IHasStats.cs +++ b/src/OpenRpg.Core/Stats/IHasStats.cs @@ -5,6 +5,5 @@ namespace OpenRpg.Core.Stats public interface IHasStats { IStatsVariables Stats { get; } - IComputedStatsVariables ComputedStats { get; } } } \ No newline at end of file diff --git a/src/OpenRpg.Core/Stats/Variables/DefaultComputedStatsVariabless.cs b/src/OpenRpg.Core/Stats/Variables/DefaultComputedStatsVariabless.cs deleted file mode 100644 index eacd34a..0000000 --- a/src/OpenRpg.Core/Stats/Variables/DefaultComputedStatsVariabless.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using OpenRpg.Core.Types; -using OpenRpg.Core.Variables; - -namespace OpenRpg.Core.Stats.Variables -{ - public class DefaultComputedStatsVariables : DefaultVariables, IComputedStatsVariables - { - public DefaultComputedStatsVariables(IDictionary internalVariables = null) : base(CoreVariableTypes.ComputedStatsVariables, internalVariables) - { - } - } -} \ No newline at end of file diff --git a/src/OpenRpg.Core/Stats/Variables/IComputedStatsVariables.cs b/src/OpenRpg.Core/Stats/Variables/IComputedStatsVariables.cs deleted file mode 100644 index e348736..0000000 --- a/src/OpenRpg.Core/Stats/Variables/IComputedStatsVariables.cs +++ /dev/null @@ -1,7 +0,0 @@ -using OpenRpg.Core.Variables.Computed; - -namespace OpenRpg.Core.Stats.Variables -{ - public interface IComputedStatsVariables : IComputedVariables - {} -} \ No newline at end of file diff --git a/src/OpenRpg.Core/Stats/Variables/IStatPopulator.cs b/src/OpenRpg.Core/Stats/Variables/IStatPopulator.cs index 7ec0eb9..87c39b1 100644 --- a/src/OpenRpg.Core/Stats/Variables/IStatPopulator.cs +++ b/src/OpenRpg.Core/Stats/Variables/IStatPopulator.cs @@ -1,8 +1,8 @@ -using OpenRpg.Core.Variables.Computed; +using OpenRpg.Core.Variables; namespace OpenRpg.Core.Stats.Variables { - public interface IStatPopulator : IComputedVariablePopulator + public interface IStatPopulator : IVariablePopulator { } } \ No newline at end of file diff --git a/src/OpenRpg.Core/Types/CoreVariableTypes.cs b/src/OpenRpg.Core/Types/CoreVariableTypes.cs index 29d642c..f4e2918 100644 --- a/src/OpenRpg.Core/Types/CoreVariableTypes.cs +++ b/src/OpenRpg.Core/Types/CoreVariableTypes.cs @@ -10,8 +10,5 @@ public interface CoreVariableTypes public static int RaceTemplateVariables = 2; public static int ClassTemplateVariables = 3; public static int ClassVariables = 4; - - // Computed Types - public static int ComputedStatsVariables = 1000; } } \ No newline at end of file diff --git a/src/OpenRpg.Core/Variables/Computed/IComputedVariablePopulator.cs b/src/OpenRpg.Core/Variables/Computed/IComputedVariablePopulator.cs deleted file mode 100644 index e6604f7..0000000 --- a/src/OpenRpg.Core/Variables/Computed/IComputedVariablePopulator.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; -using OpenRpg.Core.Effects; - -namespace OpenRpg.Core.Variables.Computed -{ - public interface IComputedVariablePopulator where T : IComputedVariables - { - T Populate(IReadOnlyCollection variables, IReadOnlyCollection activeEffects); - } -} \ No newline at end of file diff --git a/src/OpenRpg.Core/Variables/Computed/IComputedVariables.cs b/src/OpenRpg.Core/Variables/Computed/IComputedVariables.cs deleted file mode 100644 index eb63292..0000000 --- a/src/OpenRpg.Core/Variables/Computed/IComputedVariables.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace OpenRpg.Core.Variables.Computed -{ - public interface IComputedVariables : IVariables - { - } - - public interface IComputedVariables : IKeyedVariables, IComputedVariables - { - - } -} \ No newline at end of file diff --git a/src/OpenRpg.Core/Variables/IVariablePopulator.cs b/src/OpenRpg.Core/Variables/IVariablePopulator.cs new file mode 100644 index 0000000..19969e7 --- /dev/null +++ b/src/OpenRpg.Core/Variables/IVariablePopulator.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; +using OpenRpg.Core.Effects; + +namespace OpenRpg.Core.Variables +{ + public interface IVariablePopulator where T : IVariables + { + T Populate(IReadOnlyCollection activeEffects, IReadOnlyCollection variables); + } +} \ No newline at end of file