78 lines
2.8 KiB
C#
78 lines
2.8 KiB
C#
using PkmnLibSharp.Utils;
|
|
using Interface = PkmnLibSharp.FFI.StaticData.Libraries.StaticData;
|
|
|
|
namespace PkmnLibSharp.StaticData.Libraries
|
|
{
|
|
/// <summary>
|
|
/// The storage for all different libraries.
|
|
/// </summary>
|
|
public class StaticData : HandleType
|
|
{
|
|
/// <inheritdoc cref="StaticData"/>
|
|
protected StaticData(FFIHandle handle) : base(handle)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Instantiates a new data collection.
|
|
/// </summary>
|
|
public static StaticData Create(LibrarySettings settings, SpeciesLibrary speciesLibrary,
|
|
MoveLibrary moveLibrary, ItemLibrary itemLibrary, GrowthRateLibrary growthRateLibrary,
|
|
TypeLibrary typeLibrary, NatureLibrary natureLibrary, AbilityLibrary abilityLibrary)
|
|
{
|
|
var handle = Interface.static_data_new(settings.Handle, speciesLibrary.Handle, moveLibrary.Handle,
|
|
itemLibrary.Handle, growthRateLibrary.Handle, typeLibrary.Handle, natureLibrary.Handle,
|
|
abilityLibrary.Handle);
|
|
var data = Resolver.Instance.ResolveStaticData(handle.Resolve());
|
|
data.LibrarySettings = settings;
|
|
data.SpeciesLibrary = speciesLibrary;
|
|
data.MoveLibrary = moveLibrary;
|
|
data.ItemLibrary = itemLibrary;
|
|
data.GrowthRateLibrary = growthRateLibrary;
|
|
data.TypeLibrary = typeLibrary;
|
|
data.NatureLibrary = natureLibrary;
|
|
data.AbilityLibrary = abilityLibrary;
|
|
return data;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Several misc settings for the library.
|
|
/// </summary>
|
|
public LibrarySettings LibrarySettings { get; private set; } = null!;
|
|
|
|
/// <summary>
|
|
/// All data for Pokemon species.
|
|
/// </summary>
|
|
public SpeciesLibrary SpeciesLibrary { get; private set; } = null!;
|
|
|
|
/// <summary>
|
|
/// All data for the moves.
|
|
/// </summary>
|
|
public MoveLibrary MoveLibrary { get; private set; } = null!;
|
|
|
|
/// <summary>
|
|
/// All data for the items.
|
|
/// </summary>
|
|
public ItemLibrary ItemLibrary { get; private set; } = null!;
|
|
|
|
/// <summary>
|
|
/// All data for growth rates.
|
|
/// </summary>
|
|
public GrowthRateLibrary GrowthRateLibrary { get; private set; } = null!;
|
|
|
|
/// <summary>
|
|
/// All data related to types and type effectiveness.
|
|
/// </summary>
|
|
public TypeLibrary TypeLibrary { get; private set; } = null!;
|
|
|
|
/// <summary>
|
|
/// All data related to natures.
|
|
/// </summary>
|
|
public NatureLibrary NatureLibrary { get; private set; } = null!;
|
|
|
|
/// <summary>
|
|
/// All data related to abilities.
|
|
/// </summary>
|
|
public AbilityLibrary AbilityLibrary { get; private set; } = null!;
|
|
}
|
|
} |