import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.HashMap;

/**
 * Room class for representing a room
 * that a Player or Monsters can be in.
 *
 * There could be items in the room as well.
 */

public class Room
{
    private String description;
    private List<Item> items;
    private List<Monster> monsters;
    private Map<Direction, Room> exits;

    /**
     * Create a room described "description". Initially, it has
     * no exits. "description" is something like "a kitchen" or
     * "an open court yard".
     * @param description The room's description.
     */
    public Room(String description)
    {
        this.description = description;
        exits = new HashMap<Direction, Room>();
        monsters = new ArrayList<Monster>();
        items = new ArrayList<Item>();
    }

    /**
     * Adds an item to the room
     * @param i Item to add to the room
     */
    public void addItem(Item i) {
    	items.add(i);
    }

    /**
     * Add a monster to the room
     * @param m Monster to add to the room
     */
    public void addMonster(Monster m) {
    	monsters.add(m);
    }

    public Monster getMonster() {
        if(monsters.isEmpty()) return null;
        return monsters.get(0);
    }

    /**
     * Remove a monster from the room
     *
     */
    public void removeMonster(Monster m) {
        //TODO

    }

    /**
     * Define an exit from this room.
     * @param direction The direction of the exit.
     * @param neighbor  The room to which the exit leads.
     */
    public void setExit(Direction direction, Room neighbor)
    {
        exits.put(direction, neighbor);
    }

    /**
     * @return whether the room has any monsters
     */
    public boolean hasMonsters() {
    	return !monsters.isEmpty();
    }

    public List<Direction> getExitDirections() {
    	return new ArrayList<Direction>(exits.keySet());
    }

    /**
     * @return The short description of the room
     * (the one that was defined in the constructor).
     */
    public String getShortDescription()
    {
        return description;
    }

    /**
     * Return a description of the room in the form:
     *     You are in the kitchen.
     *     Exits: north west
     * @return A long description of this room
     */
    public String getLongDescription()
    {
        return "You are in " + description + ".\n" + getExitString() +
        getMonsterString() + getItemString();
    }

    /**
     * Return a string describing the room's exits, for example
     * "Exits: north west".
     * @return Details of the room's exits.
     */
    private String getExitString()
    {
        String returnString = "Exits:";
        Set<Direction> directions = exits.keySet();
        for(Direction exit : directions) {
            returnString += " " + exit.name();
        }
        return returnString + "\n";
    }

    private String getMonsterString() {
        if(monsters.isEmpty()) return "";
        String returnString = "Monsters:";
        for(Monster m: monsters) {
            returnString += " " + m;
        }
        return returnString + "\n";
    }

    private String getItemString() {
        if(items.isEmpty()) return "";
        String returnString = "Items:";
        for(Item i: items) {
            returnString += " " + i;
        }
        return returnString + "\n";
    }

    public boolean hasItem(Item i) {
        for(Item item : items) {
            if(i.equals(item)) {
                return true;
            }
        }
        return false;
    }

    /**
     * Return the room that is reached if we go from this room in direction
     * "direction". If there is no room in that direction, return null.
     * @param direction The exit's direction.
     * @return The room in the given direction.
     */
    public Room getExit(Direction direction)
    {
        return exits.get(direction);
    }
}


@@ -178,20 +178,8 @@
 yer 
-or Monsters 
 can 
@@ -198,45 +198,49 @@
  The
-re could be items in the room as well
+ room can also contain items and monsters
 .%0A *
@@ -1146,32 +1146,150 @@
 .add(m);%0A    %7D%0A%0A
+    /**%0A     * Returns the first monster found in the room%0A     * @return The first monster found in the room%0A     */%0A
     public Monst
@@ -1414,39 +1414,256 @@
 move
- a monster from the room%0A     *
+s a specific item from the room%0A     * @param i The Item object to remove%0A     */%0A    public void removeItem(Item i) %7B%0A        items.remove(i);%0A    %7D%0A%0A    /**%0A     * Remove a monster from the room%0A     * @param m The Monster to remove from the room
 %0A   
@@ -1722,15 +1722,27 @@
     
-//TODO%0A
+monsters.remove(m);
 %0A   
@@ -2538,20 +2538,16 @@
 :%0A     *
-    
  You are
@@ -2569,20 +2569,16 @@
 .%0A     *
-    
  Exits: 
@@ -3232,32 +3232,109 @@
  + %22%5Cn%22;%0A    %7D%0A%0A
+    /**%0A     * @return A string listing all the monsters in the room%0A     */%0A
     private Stri
@@ -3563,24 +3563,98 @@
 %5Cn%22;%0A    %7D%0A%0A
+    /**%0A     * @return A string listing all the items in the room%0A     */%0A
     private 
@@ -3884,123 +3884,164 @@
     
-public boolean hasItem(Item i) %7B%0A        for(Item item : items) %7B%0A            if(i.equals(item)) %7B%0A      
+/**%0A     * Uses the .equals method on items to determine if the list%0A     * contains the specific item or not. Returns the result as boolean%0A
      
+*%0A
      
+* @
 retu
@@ -4051,54 +4051,135 @@
 true
-;%0A            %7D%0A        %7D%0A        return false
+ if the room has the specific item, false if not.%0A     */%0A    public boolean hasItem(Item i) %7B%0A        return items.contains(i)
 ;%0A  

Add removeItem and update removeMonster