Add all missing docs

This commit is contained in:
2025-05-03 14:18:12 +02:00
parent 4d5dfd0342
commit 441f5dddaf
40 changed files with 400 additions and 21 deletions

View File

@@ -129,22 +129,23 @@ public record SerializedLearnedMove
public required byte CurrentPp { get; set; }
}
/// <summary>
/// A serialized stats is a representation of a Pokémon's stats that can be easily serialized and deserialized.
/// </summary>
public record SerializedStats
{
/// <inheritdoc cref="SerializedStats"/>
public SerializedStats()
{
}
public SerializedStats(ImmutableStatisticSet<byte> stats)
/// <inheritdoc cref="SerializedStats"/>
public SerializedStats(ImmutableStatisticSet<byte> stats) : this(stats.Hp, stats.Attack, stats.Defense,
stats.SpecialAttack, stats.SpecialDefense, stats.Speed)
{
Hp = stats.Hp;
Attack = stats.Attack;
Defense = stats.Defense;
SpecialAttack = stats.SpecialAttack;
SpecialDefense = stats.SpecialDefense;
Speed = stats.Speed;
}
/// <inheritdoc cref="SerializedStats"/>
public SerializedStats(long hp, long attack, long defense, long specialAttack, long specialDefense, long speed)
{
Hp = hp;
@@ -155,13 +156,39 @@ public record SerializedStats
Speed = speed;
}
/// <summary>
/// The health points stat value.
/// </summary>
public long Hp { get; set; }
/// <summary>
/// The physical attack stat value.
/// </summary>
public long Attack { get; set; }
/// <summary>
/// The physical defense stat value.
/// </summary>
public long Defense { get; set; }
/// <summary>
/// The special attack stat value.
/// </summary>
public long SpecialAttack { get; set; }
/// <summary>
/// The special defense stat value.
/// </summary>
public long SpecialDefense { get; set; }
/// <summary>
/// The speed stat value.
/// </summary>
public long Speed { get; set; }
/// <summary>
/// Converts the serialized stats to an <see cref="IndividualValueStatisticSet"/>.
/// </summary>
public IndividualValueStatisticSet ToIndividualValueStatisticSet()
{
if (Hp < 0 || Attack < 0 || Defense < 0 || SpecialAttack < 0 || SpecialDefense < 0 || Speed < 0)
@@ -174,6 +201,10 @@ public record SerializedStats
(byte)SpecialDefense, (byte)Speed);
}
/// <summary>
/// Converts the serialized stats to an <see cref="EffortValueStatisticSet"/>.
/// </summary>
/// <returns></returns>
public EffortValueStatisticSet ToEffortValueStatisticSet()
{
if (Hp < 0 || Attack < 0 || Defense < 0 || SpecialAttack < 0 || SpecialDefense < 0 || Speed < 0)