Implements dataloading

This commit is contained in:
2024-08-18 14:22:50 +02:00
parent 488c717c5a
commit d48889e21a
36 changed files with 105526 additions and 15 deletions

View File

@@ -0,0 +1,11 @@
using System.Collections.Generic;
using System.Text.Json.Nodes;
using PkmnLib.Static.Utils;
namespace PkmnLib.Dataloader.Models;
public class SerializedAbility
{
public string? Effect { get; set; }
public Dictionary<string, JsonNode> Parameters { get; set; } = new();
}

View File

@@ -0,0 +1,11 @@
namespace PkmnLib.Dataloader.Models;
public class SerializedItem
{
public string Name { get; set; }
public string ItemType { get; set; }
public string BattleType { get; set; }
public string[] Flags { get; set; }
public int Price { get; set; }
public byte FlingPower { get; set; }
}

View File

@@ -0,0 +1,30 @@
using System.Collections.Generic;
using System.Text.Json.Nodes;
namespace PkmnLib.Dataloader.Models;
public class SerializedMoveDataWrapper
{
public SerializedMove[] Data { get; set; }
}
public class SerializedMove
{
public string Name { get; set; }
public string Type { get; set; }
public byte Power { get; set; }
public byte PP { get; set; }
public byte Accuracy { get; set; }
public sbyte Priority { get; set; }
public string Target { get; set; }
public string Category { get; set; }
public string[] Flags { get; set; }
public SerializedMoveEffect? Effect { get; set; }
}
public class SerializedMoveEffect
{
public string Name { get; set; }
public float Chance { get; set; }
public Dictionary<string, JsonNode>? Parameters { get; set; }
}

View File

@@ -0,0 +1,68 @@
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Nodes;
namespace PkmnLib.Dataloader.Models;
public class SerializedSpecies
{
public string Species { get; set; }
public ushort Id { get; set; }
public float GenderRatio { get; set; }
public string GrowthRate { get; set; }
public byte BaseHappiness { get; set; }
public byte CatchRate { get; set; }
public string Color { get; set; }
public bool GenderDifference { get; set; }
public string[] EggGroups { get; set; }
public int EggCycles { get; set; }
public string[] Flags { get; set; } = [];
public Dictionary<string, SerializedForm> Formes { get; set; }
public SerializedEvolution[] Evolutions { get; set; } = [];
}
public class SerializedForm
{
public string[] Abilities { get; set; }
public string[] HiddenAbilities { get; set; } = [];
public SerializedStats BaseStats { get; set; }
public SerializedStats EVReward { get; set; }
public string[] Types { get; set; }
public float Height { get; set; }
public float Weight { get; set; }
public uint BaseExp { get; set; }
public bool IsMega { get; set; }
public SerializedMoves Moves { get; set; }
public string[] Flags { get; set; } = [];
}
public class SerializedEvolution
{
public string Species { get; set; }
public string Method { get; set; }
public JsonNode Data { get; set; }
}
public class SerializedStats
{
public ushort Hp { get; set; }
public ushort Attack { get; set; }
public ushort Defense { get; set; }
public ushort SpecialAttack { get; set; }
public ushort SpecialDefense { get; set; }
public ushort Speed { get; set; }
}
public class SerializedLevelMove
{
public string Name { get; set; }
public uint Level { get; set; }
}
public class SerializedMoves
{
public SerializedLevelMove[] LevelMoves { get; set; }
public string[] EggMoves { get; set; }
public string[] TutorMoves { get; set; }
public string[] Machine { get; set; }
}