Adds new NativePtrArray class to deal with native arrays easier.

This commit is contained in:
2020-07-25 12:52:18 +02:00
parent 4d74dcc263
commit 34c64d6b68
9 changed files with 178 additions and 13 deletions

View File

@@ -32,6 +32,13 @@ namespace PkmnLibSharpTests.Battling
20, 100));
var moves = MoveLibrary.Create(10);
moves.Insert("testMove", MoveData.Create("testMove", 0, MoveCategory.Physical, 100,
100, 20, MoveTarget.Any, 0, 0f, "",
new EffectParameter[0], new string[0]));
moves.Insert("testMove2", MoveData.Create("testMove2", 0, MoveCategory.Physical, 100,
100, 20, MoveTarget.Any, 0, 0f, "",
new EffectParameter[0], new string[0]));
var items = new ItemLibrary(10);
items.Insert("testItem", Item.Create("testItem", ItemCategory.MiscItem, BattleItemCategory.None,
500, new string[] { }, 20));

View File

@@ -36,5 +36,17 @@ namespace PkmnLibSharpTests.Battling
Assert.AreEqual(Gender.Female, pokemon.Gender);
}
[Test]
public void BuildPokemonWithMoves()
{
var lib = BattleLibraryHelper.GetLibrary();
var pokemon = new PokemonBuilder(lib, "testSpecies", 50)
.LearnMove("testMove", MoveLearnMethod.Unknown)
.LearnMove("testMove2", MoveLearnMethod.Level)
.Build();
Assert.AreEqual("testMove", pokemon.GetMoves()[0].Move.Name);
Assert.AreEqual("testMove2", pokemon.GetMoves()[1].Move.Name);
}
}
}