/**
 * Player Class.
 * This class is in charge of the Player.
 * This class has a reference to the current room that the player is in.
 * As well, there is a playerHistory variable, in order to undo and redo certain moves.
 * This class implements a doCommand method which will take the input command words and correlate them to actual actions.
 *
 */


public class Player extends Humanoid {

	private PlayerHistory playerHistory;
	private Room currentRoom;
	
	public Player(int health, Room r){
		super(health);
		currentRoom = r;
	}
	
	public Player(Room r){
		super();
		currentRoom = r;
	}
	/*
	public void undo(){
		Command c = playerHistory.undo();
		doCommand(c);
	}
	
	public void redo(){
		Command c = playerHistory.redo();
		doCommand(c);
	}
	*/
	public void doCommand(Command c){
		
		if(!c.getCommandWord().equals("UNDO")){
			playerHistory.clearRedoStack();
		}
		
		
		if (c.getCommandWord().equals("GO")){
			Direction d = (Direction) c.getSecondWord();
			Room r = currentRoom.getExit(d);
			if(r!=null){
				currentRoom = r;
			} // else error TODO
			if(playerHistory.getRedoStack().isEmpty()){
				playerHistory.addStep(c);
			}
		} else if (c.getCommandWord().equals("FIGHT")){
			Monster m = currentRoom.getMonster();
			if(m==null){
				System.out.println("Nothing to Fight!");
				//should probably call the view here..shouldn't be a system.out in this class
			} else {
			//if(this.getBestItem().compareTo(m.getBestItem()) == 1){
				m.updateHealth(this.getBestItem().getValue());
				this.updateHealth(m.getBestItem().getValue());
				if(m.getHealth()<=0){
					currentRoom.removeMonster(m);
				}
			}
			
		} else if (c.getCommandWord().equals("HELP")){
	        System.out.println("You are lost. You are alone. You wander around in a cave.\n");
	        System.out.println("Your command words are:");
	        System.out.println("GO, PICKUP, DROP, UNDO, REDO, FIGHT, HELP, QUIT");
	        //HELP may be implemented in another class.
	        
		} else if (c.getCommandWord().equals("PICKUP")){
			Item i = (Item) c.getSecondWord();
			addItem(i);
			playerHistory.addStep(c);
		} else if (c.getCommandWord().equals("DROP")){
			Item i = (Item) c.getSecondWord();
			removeItem(i);
			playerHistory.addStep(c);
			
		} else if (c.getCommandWord().equals("UNDO")){
			Command c1 = playerHistory.undo();
			doCommand(c1);//TODO recursive add to stack
		} else if (c.getCommandWord().equals("REDO")){
			Command c2 = playerHistory.redo();
			doCommand(c2);
			
		} //QUIT command does not get passed to the player
		
	}
	
	public Room getCurrentRoom(){
		return currentRoom;
	}
	
}

@@ -593,11 +593,9 @@
 %0A%09%7D%0A
-%09/*
+%0A
 %0A%09pu
@@ -608,104 +608,89 @@
 oid 
-undo()%7B%0A%09%09Command c = playerHistory.undo();%0A%09%09do
+doCommand(
 Command
-(c);
+ c)%7B
 %0A%09
-%7D%0A
 %09%0A%09
-public void redo()%7B%0A%09%09Command 
+%09if (c.getCommandWord().equals(CommandWords.UNDO))%7B%0A%09%09%09
 c = 
@@ -703,26 +703,26 @@
 History.
-re
+un
 do();%0A%09%09
 doComman
@@ -717,73 +717,19 @@
 ;%0A%09%09
-doCommand(c);%0A%09%7D%0A%09*/%0A%09public void doCommand(Command c)%7B%0A%09%09%0A%09%09if(!
+%7D else if (
 c.ge
@@ -750,29 +750,44 @@
 .equals(
-%22UN
+CommandWords.RE
 DO
-%22
 ))%7B%0A%09%09%09
+c = 
 playerHi
@@ -796,22 +796,12 @@
 ory.
-clearRedoStack
+redo
 ();%0A
@@ -846,12 +846,23 @@
 als(
-%22
+CommandWords.
 GO
-%22
 ))%7B%0A
@@ -1010,89 +1010,8 @@
 ODO%0A
-%09%09%09if(playerHistory.getRedoStack().isEmpty())%7B%0A%09%09%09%09playerHistory.addStep(c);%0A%09%09%09%7D
 %0A%09%09%7D
@@ -1050,15 +1050,26 @@
 als(
-%22
+CommandWords.
 FIGHT
-%22
 ))%7B%0A
@@ -1546,14 +1546,25 @@
 als(
-%22
+CommandWords.
 HELP
-%22
 ))%7B%0A
@@ -1897,16 +1897,27 @@
 als(
-%22
+CommandWords.
 PICKUP
-%22
 ))%7B%0A
@@ -2041,14 +2041,25 @@
 als(
-%22
+CommandWords.
 DROP
-%22
 ))%7B%0A
@@ -2143,20 +2143,16 @@
 tep(c);%0A
-%09%09%09%0A
 %09%09%7D else
@@ -2156,246 +2156,62 @@
 lse 
-if (c.getCommandWord().equals(%22UNDO%22))%7B%0A%09%09%09Command c1 = playerHistory.undo();%0A%09%09%09doCommand(c1);//TODO recursive add to stack%0A%09%09%7D else if (c.getCommandWord().equals(%22REDO%22))%7B%0A%09%09%09Command c2 = playerHistory.redo();%0A%09%09%09doCommand(c2);%0A%09%09%09
+%7B%0A%09%09%09//TODO some sort of extraneous error checking
 %0A%09%09%7D
- 
 //QU
@@ -2258,16 +2258,19 @@
 ayer%0A%09%09%0A
+%09%09%0A
 %09%7D%0A%09%0A%09pu

Change the implementation of the doCommand to reduce cohesion.