40 lines
1.9 KiB
C#
40 lines
1.9 KiB
C#
using PkmnLibSharp.Utils;
|
|
using Interface = PkmnLibSharp.FFI.StaticData.Libraries.StaticData;
|
|
|
|
namespace PkmnLibSharp.StaticData.Libraries
|
|
{
|
|
public class StaticData : HandleType
|
|
{
|
|
protected StaticData(FFIHandle handle) : base(handle)
|
|
{
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
public LibrarySettings LibrarySettings { get; private set; } = null!;
|
|
public SpeciesLibrary SpeciesLibrary { get; private set; } = null!;
|
|
public MoveLibrary MoveLibrary { get; private set; } = null!;
|
|
public ItemLibrary ItemLibrary { get; private set; } = null!;
|
|
public GrowthRateLibrary GrowthRateLibrary { get; private set; } = null!;
|
|
public TypeLibrary TypeLibrary { get; private set; } = null!;
|
|
public NatureLibrary NatureLibrary { get; private set; } = null!;
|
|
public AbilityLibrary AbilityLibrary { get; private set; } = null!;
|
|
}
|
|
} |