From f9482906ae7ce4dfd41bb4236e094be5d4fa7689 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 2 Jul 2017 01:32:07 -0400 Subject: split TrainerMod commands into separate classes (#302) --- src/TrainerMod/ItemData/ISearchItem.cs | 21 ------------- src/TrainerMod/ItemData/ItemType.cs | 15 --------- src/TrainerMod/ItemData/SearchableObject.cs | 48 ----------------------------- src/TrainerMod/ItemData/SearchableRing.cs | 48 ----------------------------- src/TrainerMod/ItemData/SearchableWeapon.cs | 48 ----------------------------- 5 files changed, 180 deletions(-) delete mode 100644 src/TrainerMod/ItemData/ISearchItem.cs delete mode 100644 src/TrainerMod/ItemData/ItemType.cs delete mode 100644 src/TrainerMod/ItemData/SearchableObject.cs delete mode 100644 src/TrainerMod/ItemData/SearchableRing.cs delete mode 100644 src/TrainerMod/ItemData/SearchableWeapon.cs (limited to 'src/TrainerMod/ItemData') diff --git a/src/TrainerMod/ItemData/ISearchItem.cs b/src/TrainerMod/ItemData/ISearchItem.cs deleted file mode 100644 index b2f7c2b8..00000000 --- a/src/TrainerMod/ItemData/ISearchItem.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace TrainerMod.ItemData -{ - /// An item that can be searched and added to the player's inventory through the console. - internal interface ISearchItem - { - /********* - ** Accessors - *********/ - /// Whether the item is valid. - bool IsValid { get; } - - /// The item ID. - int ID { get; } - - /// The item name. - string Name { get; } - - /// The item type. - ItemType Type { get; } - } -} \ No newline at end of file diff --git a/src/TrainerMod/ItemData/ItemType.cs b/src/TrainerMod/ItemData/ItemType.cs deleted file mode 100644 index 2e049aa1..00000000 --- a/src/TrainerMod/ItemData/ItemType.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace TrainerMod.ItemData -{ - /// An item type that can be searched and added to the player through the console. - internal enum ItemType - { - /// Any object in (except rings). - Object, - - /// A ring in . - Ring, - - /// A weapon from Data\weapons. - Weapon - } -} diff --git a/src/TrainerMod/ItemData/SearchableObject.cs b/src/TrainerMod/ItemData/SearchableObject.cs deleted file mode 100644 index 30362f54..00000000 --- a/src/TrainerMod/ItemData/SearchableObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -using StardewValley; - -namespace TrainerMod.ItemData -{ - /// An object that can be searched and added to the player's inventory through the console. - internal class SearchableObject : ISearchItem - { - /********* - ** Properties - *********/ - /// The underlying item. - private readonly Item Item; - - - /********* - ** Accessors - *********/ - /// Whether the item is valid. - public bool IsValid => this.Item != null && this.Item.Name != "Broken Item"; - - /// The item ID. - public int ID => this.Item.parentSheetIndex; - - /// The item name. - public string Name => this.Item.Name; - - /// The item type. - public ItemType Type => ItemType.Object; - - - /********* - ** Accessors - *********/ - /// Construct an instance. - /// The item ID. - public SearchableObject(int id) - { - try - { - this.Item = new Object(id, 1); - } - catch - { - // invalid - } - } - } -} \ No newline at end of file diff --git a/src/TrainerMod/ItemData/SearchableRing.cs b/src/TrainerMod/ItemData/SearchableRing.cs deleted file mode 100644 index 7751e6aa..00000000 --- a/src/TrainerMod/ItemData/SearchableRing.cs +++ /dev/null @@ -1,48 +0,0 @@ -using StardewValley.Objects; - -namespace TrainerMod.ItemData -{ - /// A ring that can be searched and added to the player's inventory through the console. - internal class SearchableRing : ISearchItem - { - /********* - ** Properties - *********/ - /// The underlying item. - private readonly Ring Ring; - - - /********* - ** Accessors - *********/ - /// Whether the item is valid. - public bool IsValid => this.Ring != null; - - /// The item ID. - public int ID => this.Ring.parentSheetIndex; - - /// The item name. - public string Name => this.Ring.Name; - - /// The item type. - public ItemType Type => ItemType.Ring; - - - /********* - ** Accessors - *********/ - /// Construct an instance. - /// The ring ID. - public SearchableRing(int id) - { - try - { - this.Ring = new Ring(id); - } - catch - { - // invalid - } - } - } -} \ No newline at end of file diff --git a/src/TrainerMod/ItemData/SearchableWeapon.cs b/src/TrainerMod/ItemData/SearchableWeapon.cs deleted file mode 100644 index cc9ef459..00000000 --- a/src/TrainerMod/ItemData/SearchableWeapon.cs +++ /dev/null @@ -1,48 +0,0 @@ -using StardewValley.Tools; - -namespace TrainerMod.ItemData -{ - /// A weapon that can be searched and added to the player's inventory through the console. - internal class SearchableWeapon : ISearchItem - { - /********* - ** Properties - *********/ - /// The underlying item. - private readonly MeleeWeapon Weapon; - - - /********* - ** Accessors - *********/ - /// Whether the item is valid. - public bool IsValid => this.Weapon != null; - - /// The item ID. - public int ID => this.Weapon.initialParentTileIndex; - - /// The item name. - public string Name => this.Weapon.Name; - - /// The item type. - public ItemType Type => ItemType.Weapon; - - - /********* - ** Accessors - *********/ - /// Construct an instance. - /// The weapon ID. - public SearchableWeapon(int id) - { - try - { - this.Weapon = new MeleeWeapon(id); - } - catch - { - // invalid - } - } - } -} \ No newline at end of file -- cgit