Beginnings of RepairManager interface

Not sure yet exactly what to leave in Repair and what to have in the Manager implementation.

I'm fairly sure that the xpHandler should be in Repair, but that's private at the moment so usage from the Manager is impossible except with public modifier, which is unacceptable.

Considering moving Repair to the new repair package, perhaps eventually all skills will have packages and skills.  Moving it seems like the logical solution with protected modifier.
This commit is contained in:
NuclearW 2012-05-17 04:32:14 -04:00
parent 2a46a5c00a
commit a9295751c8

View File

@ -0,0 +1,29 @@
package com.gmail.nossr50.skills.repair;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public interface RepairManager {
/**
* Register a repairable with the RepairManager
*
* @param repairable Repairable to register
*/
public void registerRepairable(Repairable repairable);
/**
* Checks if an item is repairable
*
* @param itemId id to check if repairable
* @return true if repairable, false if not
*/
public boolean isRepairable(int itemId);
/**
* Handle the repairing of this object
*
* @param player Player that is repairing an item
* @param item ItemStack that is being repaired
*/
public void handleRepair(Player player, ItemStack item);
}