Beginnings of RepairManager implementation

Plus more factories for a stronger economy
This commit is contained in:
NuclearW 2012-05-17 09:38:16 -04:00
parent 45fe8c182b
commit 26481c547a
2 changed files with 48 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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<Integer, Repairable> repairables;
protected SimpleRepairManager() {
this(55);
}
protected SimpleRepairManager(int repairablesSize) {
this.repairables = new HashMap<Integer, Repairable>(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
}
}