cannot be refrenced
Im trying to finish the code for an adventure game ive got.
I have a game class, a nonplayer class and a room class.
Game adds nonplayers to rooms, then should call a list when the look method is called.
i cant figure out how the methods should be called though. Its probably another stupid mistake on my part
Any help is much appreciated
LOOK COMMAND IN GAME CLASS
if (commandWord.equals("look"))
currentRoom.getLongDescription();
GET LONG DESCRIPTION IN ROOM CLASS
public String getLongDescription()
{
String ldesc = "You are " + description + ".\n" + getExitString();
if (nonplayers.size() > 0);
{
for (int n = 0; n < nonplayers.size(); n++)
ldesc += "In the room is " + (nonplayers.get(n).getTitle());
}
return ldesc;
}
GET TITLE IN NONPLAYER CLASS
public String getTitle()
{
return title;
}

