help with an error
at the moment i'm at home and college lectures are not for another week and im a bit lost
as i have to make this game as a project. its just im gettin an error within the gaem class
which states "addItem(Item) in player cannot be applied to (java.lang.String).
can someone please help and if u need anyother code pleasse just ask...?
within game class
privatevoid pickItem(Command command)
{
if(!command.hasSecondWord()){
// if there is no second word, we don't know what item you want
System.out.println("what item");
return;
}
String anItem = command.getSecondWord();
// try to pick the item
Item item = player.addItem(Item);
}
within player class
publicvoid addItem(Item anItem)
{
if(playerWeight + anItem.getItemWeight() <= MAXWEIGHT){
playerWeight = playerWeight + anItem.getItemWeight();
carriedItems.add(anItem);
}else{
System.out.println("the player isnt Strong enough yet to carry this item");
}
}

