All pastes #42324 Raw Edit

Anonymous

public text v1 · immutable
#42324 ·published 2006-02-20 21:24 UTC
rendered paste body
public TakeCommand()
{
}

public boolean execute(Player player)
{
    
    if(hasSecondWord())
    {
        String steal = getSecondWord();
        Room current = player.getCurrentRoom();
        int i = 0;
        for(i=0;i < current.itemList.size();i++)
        {
            Item x = (Item)current.itemList.get(i);
            String y = "";
            y = x.getItemName();
                if (steal == y){
                    current.itemList.remove(i);
                }
                  
        player.pickUpItem(x);
        player.listItems();
    }
}
    else
    {
        player.tell("What object do you want me to steal?");
    }
    return false;
}