From 26481c547aee99f4d9bcb6af265e84af9488b42e Mon Sep 17 00:00:00 2001 From: NuclearW Date: Thu, 17 May 2012 09:38:16 -0400 Subject: [PATCH] Beginnings of RepairManager implementation Plus more factories for a stronger economy --- .../skills/repair/RepairManagerFactory.java | 14 ++++++++ .../skills/repair/SimpleRepairManager.java | 34 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/main/java/com/gmail/nossr50/skills/repair/RepairManagerFactory.java create mode 100644 src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManagerFactory.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManagerFactory.java new file mode 100644 index 000000000..b37db1935 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManagerFactory.java @@ -0,0 +1,14 @@ +package com.gmail.nossr50.skills.repair; + +public class RepairManagerFactory { + public static RepairManager getRepairManager() { + // TODO: Add in loading from config what type of manager we want. + return new SimpleRepairManager(); + } + + + public static RepairManager getRepairManager(int repairablesSize) { + // TODO: Add in loading from config what type of manager we want. + return new SimpleRepairManager(repairablesSize); + } +} diff --git a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java new file mode 100644 index 000000000..0ce262529 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java @@ -0,0 +1,34 @@ +package com.gmail.nossr50.skills.repair; + +import java.util.HashMap; + +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +public class SimpleRepairManager implements RepairManager { + private HashMap repairables; + + protected SimpleRepairManager() { + this(55); + } + + protected SimpleRepairManager(int repairablesSize) { + this.repairables = new HashMap(repairablesSize); + } + + @Override + public void registerRepairable(Repairable repairable) { + // TODO Auto-generated method stub + } + + @Override + public boolean isRepairable(int itemId) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void handleRepair(Player player, ItemStack item) { + // TODO Auto-generated method stub + } +}