From 6de3e11d9487cc86a307386f1471b401c678985d Mon Sep 17 00:00:00 2001 From: LP Date: Fri, 15 Sep 2023 10:53:25 +0100 Subject: [PATCH] Forgot to add stats/state changes for populators --- src/OpenRpg.Core/OpenRpg.Core.csproj | 1 + src/OpenRpg.Core/State/IHasState.cs | 2 -- .../Populators/CompositeStatePopulator.cs | 18 ++++++++++++++++++ .../State/Populators/IPartialStatPopulator.cs | 12 ++++++++++++ .../State/Populators/IStatPopulator.cs | 12 ++++++++++++ .../Stats/Populators/CompositeStatPopulator.cs | 5 ++--- .../Stats/Populators/IPartialStatPopulator.cs | 3 +-- .../Stats/Populators/IStatPopulator.cs | 3 +-- 8 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 src/OpenRpg.Core/State/Populators/CompositeStatePopulator.cs create mode 100644 src/OpenRpg.Core/State/Populators/IPartialStatPopulator.cs create mode 100644 src/OpenRpg.Core/State/Populators/IStatPopulator.cs diff --git a/src/OpenRpg.Core/OpenRpg.Core.csproj b/src/OpenRpg.Core/OpenRpg.Core.csproj index 5788d4d..a1f559d 100644 --- a/src/OpenRpg.Core/OpenRpg.Core.csproj +++ b/src/OpenRpg.Core/OpenRpg.Core.csproj @@ -14,4 +14,5 @@ + diff --git a/src/OpenRpg.Core/State/IHasState.cs b/src/OpenRpg.Core/State/IHasState.cs index afce9f9..a290e49 100644 --- a/src/OpenRpg.Core/State/IHasState.cs +++ b/src/OpenRpg.Core/State/IHasState.cs @@ -1,5 +1,3 @@ -using OpenRpg.Core.Stats.Variables; - namespace OpenRpg.Core.State { public interface IHasState where T : IStateVariables diff --git a/src/OpenRpg.Core/State/Populators/CompositeStatePopulator.cs b/src/OpenRpg.Core/State/Populators/CompositeStatePopulator.cs new file mode 100644 index 0000000..8b7bc58 --- /dev/null +++ b/src/OpenRpg.Core/State/Populators/CompositeStatePopulator.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using OpenRpg.Core.Stats; +using OpenRpg.Core.Stats.Populators; +using OpenRpg.Core.Variables.Populators; + +namespace OpenRpg.Core.State.Populators +{ + public class CompositeStatePopulator : CompositeVariablePopulator, IStatePopulator where T : IStateVariables + { + public CompositeStatePopulator(IEnumerable> partialPopulators) : base(partialPopulators) + { + } + + protected CompositeStatePopulator() + { + } + } +} \ No newline at end of file diff --git a/src/OpenRpg.Core/State/Populators/IPartialStatPopulator.cs b/src/OpenRpg.Core/State/Populators/IPartialStatPopulator.cs new file mode 100644 index 0000000..cfba7a3 --- /dev/null +++ b/src/OpenRpg.Core/State/Populators/IPartialStatPopulator.cs @@ -0,0 +1,12 @@ +using OpenRpg.Core.Stats; +using OpenRpg.Core.Variables.Populators; + +namespace OpenRpg.Core.State.Populators +{ + /// + /// Acts as a smaller part to be used in conjunction with other populators + /// + public interface IPartialStatePopulator : IPartialVariablePopulator where T : IStateVariables + { + } +} \ No newline at end of file diff --git a/src/OpenRpg.Core/State/Populators/IStatPopulator.cs b/src/OpenRpg.Core/State/Populators/IStatPopulator.cs new file mode 100644 index 0000000..85b0751 --- /dev/null +++ b/src/OpenRpg.Core/State/Populators/IStatPopulator.cs @@ -0,0 +1,12 @@ +using OpenRpg.Core.Variables.Populators; + +namespace OpenRpg.Core.State.Populators +{ + /// + /// Provides a mechanism to populate stats from active effects + /// + public interface IStatePopulator : IVariablePopulator where T : IStateVariables + { + + } +} \ No newline at end of file diff --git a/src/OpenRpg.Core/Stats/Populators/CompositeStatPopulator.cs b/src/OpenRpg.Core/Stats/Populators/CompositeStatPopulator.cs index c55d727..b406707 100644 --- a/src/OpenRpg.Core/Stats/Populators/CompositeStatPopulator.cs +++ b/src/OpenRpg.Core/Stats/Populators/CompositeStatPopulator.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using OpenRpg.Core.Stats.Variables; using OpenRpg.Core.Variables.Populators; namespace OpenRpg.Core.Stats.Populators { - public class CompositeStatPopulator : CompositeVariablePopulator, IStatPopulator + public class CompositeStatPopulator : CompositeVariablePopulator, IStatPopulator where T : IStatsVariables { - public CompositeStatPopulator(IEnumerable partialPopulators) : base(partialPopulators) + public CompositeStatPopulator(IEnumerable> partialPopulators) : base(partialPopulators) { } diff --git a/src/OpenRpg.Core/Stats/Populators/IPartialStatPopulator.cs b/src/OpenRpg.Core/Stats/Populators/IPartialStatPopulator.cs index 2446bea..d82cb02 100644 --- a/src/OpenRpg.Core/Stats/Populators/IPartialStatPopulator.cs +++ b/src/OpenRpg.Core/Stats/Populators/IPartialStatPopulator.cs @@ -1,4 +1,3 @@ -using OpenRpg.Core.Stats.Variables; using OpenRpg.Core.Variables.Populators; namespace OpenRpg.Core.Stats.Populators @@ -6,7 +5,7 @@ namespace OpenRpg.Core.Stats.Populators /// /// Acts as a smaller part to be used in conjunction with other populators /// - public interface IPartialStatPopulator : IPartialVariablePopulator + public interface IPartialStatPopulator : IPartialVariablePopulator where T : IStatsVariables { } } \ No newline at end of file diff --git a/src/OpenRpg.Core/Stats/Populators/IStatPopulator.cs b/src/OpenRpg.Core/Stats/Populators/IStatPopulator.cs index 4c513b0..dab61c1 100644 --- a/src/OpenRpg.Core/Stats/Populators/IStatPopulator.cs +++ b/src/OpenRpg.Core/Stats/Populators/IStatPopulator.cs @@ -1,4 +1,3 @@ -using OpenRpg.Core.Stats.Variables; using OpenRpg.Core.Variables.Populators; namespace OpenRpg.Core.Stats.Populators @@ -6,7 +5,7 @@ namespace OpenRpg.Core.Stats.Populators /// /// Provides a mechanism to populate stats from active effects /// - public interface IStatPopulator : IVariablePopulator + public interface IStatPopulator : IVariablePopulator where T : IStatsVariables { }