Condense some more expressions

This commit is contained in:
Kurt 2020-12-31 23:13:27 -08:00
parent 080f6f827d
commit fb008be6a6
2 changed files with 6 additions and 6 deletions

View file

@ -126,11 +126,11 @@ namespace PKHeX.Core
return slot.Species switch
{
(int) Core.Species.Yamask when pk.Species != slot.Species && slot.Form == 1 && pk is IFormArgument f => f.FormArgument == 0,
(int) Core.Species.Milcery when pk.Species != slot.Species && pk is IFormArgument f => f.FormArgument == 0,
(int) Core.Species.Yamask when pk.Species != slot.Species && slot.Form == 1 => pk is IFormArgument {FormArgument: 0},
(int) Core.Species.Milcery when pk.Species != slot.Species => pk is IFormArgument {FormArgument: 0},
(int) Core.Species.Runerigus when pk is IFormArgument f && f.FormArgument != 0 => true,
(int) Core.Species.Alcremie when pk is IFormArgument f && f.FormArgument != 0 => true,
(int) Core.Species.Runerigus => pk is IFormArgument {FormArgument: not 0},
(int) Core.Species.Alcremie => pk is IFormArgument {FormArgument: not 0},
_ => false,
};

View file

@ -1892,7 +1892,7 @@ namespace PKHeX.WinForms.Controls
private void CB_BattleVersion_SelectedValueChanged(object sender, EventArgs e)
{
PB_BattleVersion.Image = GetMarkSprite(PB_BattleVersion, Entity is IBattleVersion b && b.BattleVersion != 0);
PB_BattleVersion.Image = GetMarkSprite(PB_BattleVersion, Entity is IBattleVersion {BattleVersion: not 0});
}
private static Image GetMarkSprite(PictureBox p, bool opaque, double trans = 0.175)
@ -1976,7 +1976,7 @@ namespace PKHeX.WinForms.Controls
var game = source.Games;
var gamesWith0 = new List<ComboItem>(1 + game.Count) {GameInfo.Sources.Empty};
gamesWith0.AddRange(lang);
gamesWith0.AddRange(game);
SetIfDifferentCount(gamesWith0, CB_BattleVersion, force);
}
SetIfDifferentCount(source.Species, CB_Species, force);