Begin work on outlining dynamic side

This commit is contained in:
2024-07-27 16:26:45 +02:00
parent 1b501dee7e
commit a251913ebd
44 changed files with 2150 additions and 19 deletions

View File

@@ -0,0 +1,55 @@
using PkmnLib.Static.Libraries;
namespace PkmnLib.Dynamic.Libraries;
/// <summary>
/// The dynamic library stores a static data library, as well as holding different libraries and
/// calculators that might be customized between different generations and implementations.
/// </summary>
public interface IDynamicLibrary
{
/// <summary>
/// The static data is the immutable storage data for this library.
/// </summary>
IStaticLibrary StaticLibrary { get; }
/// <summary>
/// The stat calculator deals with the calculation of flat and boosted stats, based on the
/// Pokémon's attributes.
/// </summary>
IBattleStatCalculator StatCalculator { get; }
/// <summary>
/// The damage calculator deals with the calculation of things relating to damage.
/// </summary>
IDamageCalculator DamageCalculator { get; }
/// <summary>
/// The Misc Library holds minor functions that do not fall in any of the other libraries and
/// calculators.
/// </summary>
IMiscLibrary MiscLibrary { get; }
}
public class DynamicLibraryImpl : IDynamicLibrary
{
public DynamicLibraryImpl(IStaticLibrary staticLibrary, IBattleStatCalculator statCalculator,
IDamageCalculator damageCalculator, IMiscLibrary miscLibrary)
{
StaticLibrary = staticLibrary;
StatCalculator = statCalculator;
DamageCalculator = damageCalculator;
MiscLibrary = miscLibrary;
}
public IStaticLibrary StaticLibrary { get; }
/// <inheritdoc />
public IBattleStatCalculator StatCalculator { get; }
/// <inheritdoc />
public IDamageCalculator DamageCalculator { get; }
/// <inheritdoc />
public IMiscLibrary MiscLibrary { get; }
}