I'm trying to define some properties for objects in a game, so I use interfaces to specify them.
I've created a Interactable
interface, but then I want to create a Eatable
interface, which obviously implements Interactable
because the interaction is to eat, but I can't do that because I can't implement a method in an interface.
Is there a workaround?
public interface Interactable {
void interact();
}
public interface Eatable implements Interactable {
public void eat();
public void interact() {
// Obviously, this doesn't work
eat();
}
}