mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-23 10:53:10 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Encounter Slot found in <see cref="GameVersion.Gen3"/>.
|
|
/// </summary>
|
|
/// <inheritdoc cref="EncounterSlot"/>
|
|
public record EncounterSlot3 : EncounterSlot, IMagnetStatic, INumberedSlot, ISlotRNGType
|
|
{
|
|
public sealed override int Generation => 3;
|
|
|
|
public byte StaticIndex { get; }
|
|
public byte MagnetPullIndex { get; }
|
|
public byte StaticCount { get; }
|
|
public byte MagnetPullCount { get; }
|
|
public SlotType Type => Area.Type;
|
|
|
|
public byte SlotNumber { get; }
|
|
public override Ball FixedBall => Locations.IsSafariZoneLocation3(Location) ? Ball.Safari : Ball.None;
|
|
|
|
public EncounterSlot3(EncounterArea3 area, ushort species, byte form, byte min, byte max, byte slot, byte mpi, byte mpc, byte sti, byte stc) : base(area, species, form, min, max)
|
|
{
|
|
SlotNumber = slot;
|
|
|
|
MagnetPullIndex = mpi;
|
|
MagnetPullCount = mpc;
|
|
|
|
StaticIndex = sti;
|
|
StaticCount = stc;
|
|
}
|
|
|
|
public override EncounterMatchRating GetMatchRating(PKM pk)
|
|
{
|
|
if (IsDeferredSafari3(pk.Ball == (int)Ball.Safari))
|
|
return EncounterMatchRating.PartialMatch;
|
|
return base.GetMatchRating(pk);
|
|
}
|
|
|
|
private bool IsDeferredSafari3(bool IsSafariBall) => IsSafariBall != Locations.IsSafariZoneLocation3(Location);
|
|
}
|