From c48b25f8e20c69d13725c267265ff2f2be7a8c38 Mon Sep 17 00:00:00 2001 From: riking Date: Tue, 8 Oct 2013 21:10:32 -0700 Subject: [PATCH] Remove RepairableManagerFactory until we actually need it Let's hold off on the factory pattern until we actually offer choices. --- src/main/java/com/gmail/nossr50/mcMMO.java | 4 ++-- .../repairables/RepairableManagerFactory.java | 14 -------------- .../repairables/SimpleRepairableManager.java | 4 ++-- 3 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableManagerFactory.java diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index a1940001f..0512a857f 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -38,7 +38,7 @@ import com.gmail.nossr50.skills.child.ChildConfig; import com.gmail.nossr50.skills.repair.config.RepairConfigManager; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.RepairableManager; -import com.gmail.nossr50.skills.repair.repairables.RepairableManagerFactory; +import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager; import com.gmail.nossr50.util.ChimaeraWing; import com.gmail.nossr50.util.LogFilter; import com.gmail.nossr50.util.Misc; @@ -357,7 +357,7 @@ public class mcMMO extends JavaPlugin { // Load repair configs, make manager, and register them at this time RepairConfigManager rManager = new RepairConfigManager(this); repairables.addAll(rManager.getLoadedRepairables()); - repairableManager = RepairableManagerFactory.getRepairManager(repairables.size()); + repairableManager = new SimpleRepairableManager(repairables.size()); repairableManager.registerRepairables(repairables); } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableManagerFactory.java b/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableManagerFactory.java deleted file mode 100644 index 274687d1f..000000000 --- a/src/main/java/com/gmail/nossr50/skills/repair/repairables/RepairableManagerFactory.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.gmail.nossr50.skills.repair.repairables; - - -public class RepairableManagerFactory { - public static RepairableManager getRepairManager() { - // TODO: Add in loading from config what type of manager we want. - return new SimpleRepairableManager(); - } - - public static RepairableManager getRepairManager(int repairablesSize) { - // TODO: Add in loading from config what type of manager we want. - return new SimpleRepairableManager(repairablesSize); - } -} diff --git a/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java b/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java index 0711b7149..6fe40db0b 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java @@ -10,11 +10,11 @@ import org.bukkit.inventory.ItemStack; public class SimpleRepairableManager implements RepairableManager { private HashMap repairables; - protected SimpleRepairableManager() { + public SimpleRepairableManager() { this(55); } - protected SimpleRepairableManager(int repairablesSize) { + public SimpleRepairableManager(int repairablesSize) { this.repairables = new HashMap(repairablesSize); }