Updates to latest pkmnlib, fixes issues.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using PkmnLibSharp.Battling;
|
||||
using PkmnLibSharp.Library;
|
||||
using PkmnLibSharp.Library.GrowthRates;
|
||||
@@ -10,15 +11,23 @@ namespace PkmnLibSharpTests.Battling
|
||||
public static class BattleLibraryHelper
|
||||
{
|
||||
private static BattleLibrary _cache;
|
||||
private static readonly object Lock = new object();
|
||||
|
||||
public static BattleLibrary GetLibrary()
|
||||
{
|
||||
if (_cache != null) return _cache;
|
||||
|
||||
_cache = new BattleLibrary(BuildStatic(), new StatCalculator(), new DamageLibrary(),
|
||||
new ExperienceLibrary(),
|
||||
new AngelScriptResolver(), new MiscLibrary());
|
||||
return _cache;
|
||||
lock (Lock)
|
||||
{
|
||||
if (_cache != null)
|
||||
return _cache;
|
||||
|
||||
TestContext.WriteLine("Building battle library");
|
||||
var scriptLibrary = new AngelScriptResolver();
|
||||
_cache = new BattleLibrary(BuildStatic(), new StatCalculator(), new DamageLibrary(),
|
||||
new ExperienceLibrary(),
|
||||
scriptLibrary, new MiscLibrary());
|
||||
scriptLibrary.Initialize(_cache);
|
||||
return _cache;
|
||||
}
|
||||
}
|
||||
|
||||
private static PokemonLibrary BuildStatic()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using PkmnLibSharp.Battling;
|
||||
using PkmnLibSharp.Library;
|
||||
@@ -15,7 +16,7 @@ namespace PkmnLibSharpTests.Battling
|
||||
|
||||
protected override Pokemon Finalize(Species species, Forme forme, Item? heldItem, IReadOnlyCollection<LearnedMove> moves, Nature nature)
|
||||
{
|
||||
var pkmn = new Pokemon(Library, species, forme!, Level, Experience, Uid, Gender, Coloring,
|
||||
var pkmn = new Pokemon(Library, species, forme, Level, Experience, Uid, Gender, Coloring,
|
||||
heldItem, Nickname, HiddenAbility, (byte) AbilityIndex, moves, IVs, EVs, nature);
|
||||
return pkmn;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using PkmnLibSharp.Battling;
|
||||
using PkmnLibSharp.Library;
|
||||
|
||||
Reference in New Issue
Block a user