Additional functionality.
This commit is contained in:
@@ -28,8 +28,8 @@ namespace PkmnLibSharpTests.Battling
|
||||
species.Insert("testSpecies", new Species(1, "testSpecies",
|
||||
new Forme("default", 10f, 10f, 100, new byte[] {0, 1}, 100,
|
||||
100, 100, 100, 100, 100, new[] {"testAbility", "testAbility2"},
|
||||
new[] {"testHiddenAbility"}, new LearnableMoves(100)), 0.5f, "growthRate",
|
||||
20, 100, new[]{"testEggGroup"}));
|
||||
new[] {"testHiddenAbility"}, new LearnableMoves(100), new string[0]), 0.5f, "growthRate",
|
||||
20, 100, new[]{"testEggGroup"}, new string[0]));
|
||||
|
||||
var moves = new MoveLibrary(10);
|
||||
moves.Insert("testMove", new MoveData("testMove", 0, MoveCategory.Physical, 100,
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void ConstructDestruct()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
forme.Dispose();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetName()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual("foo", forme.Name);
|
||||
forme.Dispose();
|
||||
}
|
||||
@@ -26,7 +26,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetHeight()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual(1f, forme.Height);
|
||||
forme.Dispose();
|
||||
}
|
||||
@@ -35,7 +35,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetWeight()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual(2f, forme.Weight);
|
||||
forme.Dispose();
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetBaseExperience()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual(100, forme.BaseExperience);
|
||||
forme.Dispose();
|
||||
}
|
||||
@@ -53,12 +53,12 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetTypes()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual(0, forme.GetPkmnType(0));
|
||||
forme.Dispose();
|
||||
|
||||
forme = new Forme("foo", 1, 2, 100, new byte[] {0, 1}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual(0, forme.GetPkmnType(0));
|
||||
Assert.AreEqual(1, forme.GetPkmnType(1));
|
||||
forme.Dispose();
|
||||
@@ -68,7 +68,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetStats()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 20, 30, 40, 50, 60, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual(10, forme.BaseHealth);
|
||||
Assert.AreEqual(20, forme.BaseAttack);
|
||||
Assert.AreEqual(30, forme.BaseDefense);
|
||||
@@ -82,7 +82,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetAbilities()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual("foo", forme.Abilities[0]);
|
||||
forme.Dispose();
|
||||
}
|
||||
@@ -91,7 +91,7 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetHiddenAbilities()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
Assert.AreEqual("bar", forme.HiddenAbilities[0]);
|
||||
forme.Dispose();
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void Insert()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
var library = new SpeciesLibrary(100);
|
||||
library.Insert("foobar", species);
|
||||
Assert.AreEqual(1, library.Count);
|
||||
@@ -29,8 +29,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void Delete()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
var library = new SpeciesLibrary(100);
|
||||
library.Insert("foobar", species);
|
||||
Assert.AreEqual(1, library.Count);
|
||||
@@ -43,8 +43,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void Get()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
var library = new SpeciesLibrary(100);
|
||||
library.Insert("foobar", species);
|
||||
Assert.AreEqual(1, library.Count);
|
||||
@@ -61,8 +61,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void TryGet()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
var library = new SpeciesLibrary(100);
|
||||
library.Insert("foobar", species);
|
||||
Assert.AreEqual(1, library.Count);
|
||||
|
||||
@@ -10,8 +10,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void ConstructDestruct()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(0, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
species.Dispose();
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetId()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.AreEqual(10, species.Id);
|
||||
species.Dispose();
|
||||
}
|
||||
@@ -28,8 +28,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetGenderRate()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.AreEqual(0.5f, species.GenderRate);
|
||||
species.Dispose();
|
||||
}
|
||||
@@ -37,8 +37,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetCaptureRate()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.AreEqual(100, species.CaptureRate);
|
||||
species.Dispose();
|
||||
}
|
||||
@@ -46,8 +46,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetName()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.AreEqual("testSpecies", species.Name);
|
||||
species.Dispose();
|
||||
}
|
||||
@@ -55,8 +55,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetGrowthRate()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.AreEqual("exponential", species.GrowthRate);
|
||||
species.Dispose();
|
||||
}
|
||||
@@ -64,8 +64,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void HasForme()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.True(species.HasForme("default"));
|
||||
species.Dispose();
|
||||
}
|
||||
@@ -73,11 +73,11 @@ namespace PkmnLibSharpTests.Library
|
||||
public void SetForme()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.True(species.HasForme("default"));
|
||||
forme = new Forme("bar", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
species.SetForme("bar", forme);
|
||||
Assert.True(species.HasForme("bar"));
|
||||
species.Dispose();
|
||||
@@ -86,8 +86,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void GetForme()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
var f = species.GetForme("default");
|
||||
Assert.AreEqual(forme, f);
|
||||
Assert.Throws<NativeException>(() =>
|
||||
@@ -100,8 +100,8 @@ namespace PkmnLibSharpTests.Library
|
||||
public void TrGetForme()
|
||||
{
|
||||
var forme = new Forme("foo", 1, 2, 100, new byte[] {0}, 10, 10, 10, 10, 10, 10, new[] {"foo"},
|
||||
new[] {"bar"}, new LearnableMoves(100));
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"});
|
||||
new[] {"bar"}, new LearnableMoves(100), new string[0]);
|
||||
var species = new Species(10, "testSpecies", forme, 0.5f, "exponential", 100, 80, new[]{"testEggGroup"}, new string[0]);
|
||||
Assert.True(species.TryGetForme("default", out var f));
|
||||
Assert.AreEqual(forme, f);
|
||||
Assert.False(species.TryGetForme("non-existing", out f));
|
||||
|
||||
Reference in New Issue
Block a user