mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 04:23:12 +00:00
Remove unnecessary casts
This commit is contained in:
parent
c14c3b14e8
commit
0dd4d1fe7a
9 changed files with 10 additions and 9 deletions
|
@ -55,7 +55,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
return info switch
|
||||
{
|
||||
SlotInfoParty p => (SlotReversion) new PartyReversion(p, sav),
|
||||
SlotInfoParty p => new PartyReversion(p, sav),
|
||||
_ => new SingleSlotReversion(info, sav)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -170,7 +170,7 @@ namespace PKHeX.Core
|
|||
2 => ParsePK7,
|
||||
7 => ParsePK7,
|
||||
|
||||
8 => (Action)ParsePK8,
|
||||
8 => ParsePK8,
|
||||
|
||||
_ => throw new Exception()
|
||||
};
|
||||
|
|
|
@ -373,7 +373,7 @@ namespace PKHeX.Core
|
|||
6 => WildPokeballs6,
|
||||
7 => (pkm.GG ? WildPokeballs7b : WildPokeballs7),
|
||||
8 => WildPokeballs8,
|
||||
_ => (ICollection<int>)Array.Empty<int>()
|
||||
_ => Array.Empty<int>()
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -431,7 +431,7 @@ namespace PKHeX.Core
|
|||
3 => FutureEvolutionsGen3,
|
||||
4 => FutureEvolutionsGen4,
|
||||
5 => FutureEvolutionsGen5,
|
||||
_ => (ICollection<int>)Array.Empty<int>()
|
||||
_ => Array.Empty<int>()
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
return type switch
|
||||
{
|
||||
EncounterOrder.Egg => (IEnumerable<IEncounterable>)GetEggs(pk, needs, version),
|
||||
EncounterOrder.Egg => GetEggs(pk, needs, version),
|
||||
EncounterOrder.Mystery => GetGifts(pk, needs),
|
||||
EncounterOrder.Static => GetStatic(pk, needs),
|
||||
EncounterOrder.Trade => GetTrades(pk, needs),
|
||||
|
|
|
@ -275,7 +275,7 @@ namespace PKHeX.Core
|
|||
6 => GetMovesLevelUp6(species, form, lvl, version),
|
||||
7 => GetMovesLevelUp7(species, form, lvl, MoveReminder, version),
|
||||
8 => GetMovesLevelUp8(species, form, lvl, version),
|
||||
_ => (IEnumerable<int>)Array.Empty<int>()
|
||||
_ => Array.Empty<int>()
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace PKHeX.Core.Searching
|
|||
return Clones switch
|
||||
{
|
||||
CloneDetectionMethod.HashPID => HashByPID,
|
||||
_ => (Func<PKM, string>)HashByDetails,
|
||||
_ => HashByDetails,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace PKHeX.Core
|
|||
{
|
||||
PokeCrypto.SIZE_3CSTORED => new CK3(data),
|
||||
PokeCrypto.SIZE_3XSTORED => new XK3(data),
|
||||
_ => (PKM)new PK3(data)
|
||||
_ => new PK3(data)
|
||||
};
|
||||
case 4:
|
||||
var pk = new PK4(data);
|
||||
|
|
|
@ -604,7 +604,7 @@ namespace PKHeX.WinForms.Controls
|
|||
SAV7 s7 => new SAV_Trainer7(s7),
|
||||
SAV7b b7 => new SAV_Trainer7GG(b7),
|
||||
SAV8SWSH swsh => new SAV_Trainer8(swsh),
|
||||
_ => (Form) new SAV_SimpleTrainer(sav)
|
||||
_ => new SAV_SimpleTrainer(sav)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ namespace PKHeX.Tests.Legality
|
|||
legality.Valid.Should().BeTrue($"because the file '{fi.Directory.Name}\\{fi.Name}' should be invalid, but found:{Environment.NewLine}{msg}");
|
||||
}
|
||||
}
|
||||
ctr.Should().BeGreaterThan(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue