30 lines
1.3 KiB
C#
30 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using PkmnLibSharp.Library;
|
|
using PkmnLibSharp.Utilities;
|
|
using Item = PkmnLibSharp.Library.Items.Item;
|
|
using Nature = PkmnLibSharp.Library.Nature;
|
|
|
|
namespace PkmnLibSharp.Battling
|
|
{
|
|
public class Pokemon : PointerWrapper
|
|
{
|
|
public Pokemon(BattleLibrary library, Species species, Forme forme, byte level, uint experience, uint uid,
|
|
Gender gender, byte coloring, Item heldItem, string nickname, bool hiddenAbility, byte abilityIndex,
|
|
IReadOnlyCollection<LearnedMove> moves, StatisticSet<byte> ivs, StatisticSet<byte> evs, Nature nature) :
|
|
base(Pkmnlib.Generated.Pokemon.Construct(library.Ptr, species.Ptr, forme.Ptr, level, experience,
|
|
uid, (Pkmnlib.Gender) gender, coloring, heldItem.Ptr, nickname.ToPtr(), hiddenAbility.ToNative(),
|
|
abilityIndex,
|
|
moves.Select(x => x.Ptr).ToArray().ArrayPtr(),
|
|
(ulong) moves.Count,
|
|
ivs.HP, ivs.Attack, ivs.Defense, ivs.SpecialAttack,
|
|
ivs.SpecialDefense, ivs.Speed, evs.HP, evs.Attack, evs.Defense,
|
|
evs.SpecialAttack, evs.SpecialDefense, evs.Speed, nature.Ptr))
|
|
{}
|
|
|
|
protected override void DeletePtr()
|
|
{
|
|
Pkmnlib.Generated.Pokemon.Destruct(Ptr);
|
|
}
|
|
}
|
|
} |