Skip to content

Commit

Permalink
Forgot to add stats/state changes for populators
Browse files Browse the repository at this point in the history
  • Loading branch information
grofit committed Sep 15, 2023
1 parent ff09806 commit 6de3e11
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/OpenRpg.Core/OpenRpg.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@




</Project>
2 changes: 0 additions & 2 deletions src/OpenRpg.Core/State/IHasState.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using OpenRpg.Core.Stats.Variables;

namespace OpenRpg.Core.State
{
public interface IHasState<out T> where T : IStateVariables
Expand Down
18 changes: 18 additions & 0 deletions src/OpenRpg.Core/State/Populators/CompositeStatePopulator.cs
Original file line number Diff line number Diff line change
@@ -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<T> : CompositeVariablePopulator<T>, IStatePopulator<T> where T : IStateVariables
{
public CompositeStatePopulator(IEnumerable<IPartialStatePopulator<T>> partialPopulators) : base(partialPopulators)
{
}

protected CompositeStatePopulator()
{
}
}
}
12 changes: 12 additions & 0 deletions src/OpenRpg.Core/State/Populators/IPartialStatPopulator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using OpenRpg.Core.Stats;
using OpenRpg.Core.Variables.Populators;

namespace OpenRpg.Core.State.Populators
{
/// <summary>
/// Acts as a smaller part to be used in conjunction with other populators
/// </summary>
public interface IPartialStatePopulator<in T> : IPartialVariablePopulator<T> where T : IStateVariables
{
}
}
12 changes: 12 additions & 0 deletions src/OpenRpg.Core/State/Populators/IStatPopulator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using OpenRpg.Core.Variables.Populators;

namespace OpenRpg.Core.State.Populators
{
/// <summary>
/// Provides a mechanism to populate stats from active effects
/// </summary>
public interface IStatePopulator<in T> : IVariablePopulator<T> where T : IStateVariables
{

}
}
5 changes: 2 additions & 3 deletions src/OpenRpg.Core/Stats/Populators/CompositeStatPopulator.cs
Original file line number Diff line number Diff line change
@@ -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<IStatsVariables>, IStatPopulator
public class CompositeStatPopulator<T> : CompositeVariablePopulator<T>, IStatPopulator<T> where T : IStatsVariables
{
public CompositeStatPopulator(IEnumerable<IPartialStatPopulator> partialPopulators) : base(partialPopulators)
public CompositeStatPopulator(IEnumerable<IPartialStatPopulator<T>> partialPopulators) : base(partialPopulators)
{
}

Expand Down
3 changes: 1 addition & 2 deletions src/OpenRpg.Core/Stats/Populators/IPartialStatPopulator.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using OpenRpg.Core.Stats.Variables;
using OpenRpg.Core.Variables.Populators;

namespace OpenRpg.Core.Stats.Populators
{
/// <summary>
/// Acts as a smaller part to be used in conjunction with other populators
/// </summary>
public interface IPartialStatPopulator : IPartialVariablePopulator<IStatsVariables>
public interface IPartialStatPopulator<in T> : IPartialVariablePopulator<T> where T : IStatsVariables
{
}
}
3 changes: 1 addition & 2 deletions src/OpenRpg.Core/Stats/Populators/IStatPopulator.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using OpenRpg.Core.Stats.Variables;
using OpenRpg.Core.Variables.Populators;

namespace OpenRpg.Core.Stats.Populators
{
/// <summary>
/// Provides a mechanism to populate stats from active effects
/// </summary>
public interface IStatPopulator : IVariablePopulator<IStatsVariables>
public interface IStatPopulator<in T> : IVariablePopulator<T> where T : IStatsVariables
{

}
Expand Down

0 comments on commit 6de3e11

Please sign in to comment.