Rework constructors to remove the Create pattern.
This commit is contained in:
@@ -13,7 +13,7 @@ namespace PkmnLibSharp.Library.GrowthRates
|
||||
{
|
||||
}
|
||||
|
||||
public static ExternGrowthRate Create(CalculateLevelDelegate levelFunc,
|
||||
public ExternGrowthRate(CalculateLevelDelegate levelFunc,
|
||||
CalculateExperienceDelegate experienceFunc)
|
||||
{
|
||||
var ptr = IntPtr.Zero;
|
||||
@@ -21,7 +21,7 @@ namespace PkmnLibSharp.Library.GrowthRates
|
||||
Marshal.GetFunctionPointerForDelegate(levelFunc),
|
||||
Marshal.GetFunctionPointerForDelegate(experienceFunc)
|
||||
);
|
||||
return new ExternGrowthRate(ptr);
|
||||
Initialize(ptr);
|
||||
}
|
||||
|
||||
protected override void DeletePtr()
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace PkmnLibSharp.Library.GrowthRates
|
||||
internal GrowthRate(IntPtr ptr) : base(ptr)
|
||||
{
|
||||
}
|
||||
|
||||
protected GrowthRate(){}
|
||||
|
||||
public byte CalculateLevel(uint experience)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user