diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-06 18:25:00 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-06 18:25:00 -0400 |
commit | 0539bb8f3705e5c50d0e5790e2af97f39aed04b8 (patch) | |
tree | c21f468cdae670432aa067d97f71106a23210608 /src/SMAPI.Mods.ConsoleCommands/Framework | |
parent | b6c8cfc28b2c94e6dc3cb07d3058371dd6775e70 (diff) | |
download | SMAPI-0539bb8f3705e5c50d0e5790e2af97f39aed04b8.tar.gz SMAPI-0539bb8f3705e5c50d0e5790e2af97f39aed04b8.tar.bz2 SMAPI-0539bb8f3705e5c50d0e5790e2af97f39aed04b8.zip |
simplify with newer pattern features
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework')
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs | 5 | ||||
-rw-r--r-- | src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs index d388f4b0..7935b05f 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs @@ -94,9 +94,8 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World this.RemoveObjects(location, obj => obj is not Chest && ( - obj.Name == "Weeds" - || obj.Name == "Stone" - || (obj.ParentSheetIndex == 294 || obj.ParentSheetIndex == 295) + obj.Name is "Weeds" or "Stone" + || obj.ParentSheetIndex is 294 or 295 ) ) + this.RemoveResourceClumps(location, clump => this.DebrisClumps.Contains(clump.parentSheetIndex.Value)); diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs index 9b48fa99..ca313f41 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs @@ -106,7 +106,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework { foreach (int id in this.TryLoad<int, string>("Data\\weapons").Keys) { - yield return this.TryCreate(ItemType.Weapon, id, p => (p.ID >= 32 && p.ID <= 34) + yield return this.TryCreate(ItemType.Weapon, id, p => p.ID is >= 32 and <= 34 ? (Item)new Slingshot(p.ID) : new MeleeWeapon(p.ID) ); |