Move data and data loading to plugin libraries.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using PkmnLib.Dynamic.Libraries.DataLoaders.Models;
|
||||
using PkmnLib.Static.Moves;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Dynamic.Libraries.DataLoaders;
|
||||
|
||||
internal static class CommonDataLoaderHelper
|
||||
{
|
||||
internal static ISecondaryEffect? ParseEffect(this SerializedMoveEffect? effect)
|
||||
{
|
||||
if (effect == null)
|
||||
return null;
|
||||
var name = effect.Name;
|
||||
var chance = effect.Chance ?? -1;
|
||||
var parameters = effect.Parameters?.ToDictionary(x => (StringKey)x.Key, x => x.Value.ToParameter()) ??
|
||||
new Dictionary<StringKey, object?>();
|
||||
return new SecondaryEffectImpl(chance, name, parameters);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user