I'm creating a text adventure game in Java. I've created an exit, room, creature and an item class, and now I'm instantiating and putting values for them in my main class.
I'm getting this problem though: as I'm creating exits for my room, I'm getting a compiler error saying
Constructor Exit in class Exit cannot be applied to given types
This is the line of code I'm getting the compiler error for:
Exit exit1 = new Exit("Exit1", "Exit description", "Exit transition text");
and in my Exit
class I have this constructor method:
public void Exit(String exit, String exitDescription, String exitTransition) {
this.Exit(exit, exitDescription, exitTransition);
}
but every time I tell the IDE (Netbeans) to correct the compiler error, it generates this in my Exit
class:
Exit(String exit1, String exit_description, String exit_transition_text) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
So my question is, why doesn't my constructor method work? Also, I had help from my professor and I believe he said that I don't want the generated code. Don't remember exactly though.