define(
// Requirements
["lib/undo-manager", "bearing", "lib/jquery"],

// Module definition
function (UndoManager, Bearing) {

var Player = function (config) {
    
    var self = this;
    
    // Default configuration
    var defaultConfig = {
        x: 0,
        y: 0,
        bearing: Bearing.NORTH
    };
    
    config = $.extend({}, defaultConfig, config);
    
    // Set up undo/redo
    var undoManager = new UndoManager();
    self.hasUndo = undoManager.hasUndo;
    self.hasRedo = undoManager.hasRedo;
    
    /**
     * Redo a previously undone action.
     */
    self.redo = function () {
        // TODO
    }
    
    /**
     * Undo a previously recorded action.
     */
    self.undo = function () {
        // TODO
    }
    
    // Define getters for x/y coords to make 'em easier to access.
    self.__defineGetter__("x", function () {
        return config.x;
    });
    self.__defineGetter__("y", function () {
        return config.y;
    });
    
    /**
     * Move the Player.  If no arguments are given, the player will be moved by
     * one tile in the direction of their current bearing.
     *
     * @param {Number} [x] - X position to move the Player to.
     * @param {Number} [y] - Y position to move the player to.
     * @param {Number} [bearing] - The new bearing for the user to face.
     * 
     * @return Void
     */
    self.move = function (newX, newY, newBearing) {
        // Move the Player and store a copy of the data that is generated.
        var stepData = _movePlayer(newX, newY, newBearing);
        
        // TODO: Check redo stack to see if the requested movement is a copy of previously recorded action.
        
        // Add the movement action to the undo/redo stack.
        undoManager.add({
            undo: function () {
                _move(stepData.from.x, stepData.from.y);
            },
            redo: function () {
                _move(stepData.to.x, stepData.to.y);
            }
        });
    };
    
    /**
     * Private function to facilitate the actual movement logic.  Clients that
     * are external to the Player module will make use of this by calling
     * Player.move() on a Player instance.
     * @private
     */
    function _move (newX, newY, newBearing) {
        // Derive new values if necessary.
        newX = newX || config.bearing[0];
        newY = newY || config.bearing[1];
        newBearing = newBearing || config.bearing;
        
        var stepData = {
            from: {
                x: config.x,
                y: config.y,
                bearing: config.bearing
            },
            to: {
                x: newX,
                y: newY,
                bearing: newBearing
            },
        }
        
        // Update current values.
        config.x = newX;
        config.y = newY;
        self.bear(newBearing);
        
        return stepData;
    }
    
    /**
     * Causes the player to face a different direction.
     *
     * @param {Array} direction - An array representing a cardinal direction.
     * @return Void
     */
    self.bear = function (direction) {
        switch(direction) {
            case Bearing.NORTH:
            case Bearing.EAST:
            case Bearing.SOUTH:
            case Bearing.WEST:
                config.baring = direction;
                break;
            default:
                throw Error("Invalid direction given to Player.move(), '" + direction + "'");
        }
    };
}

return Player;
});
@@ -285,29 +285,29 @@
 earing: 
-Bearing.NORTH
+%5B0, -1, 0, 1%5D
 %0A    %7D;%0A
@@ -2922,14 +2922,14 @@
   * 
-Causes
+Return
  the
@@ -2939,168 +2939,150 @@
 ayer
- to face a different direction.%0A     *%0A     * @param %7BArray%7D direction - An array representing a cardinal direction.%0A     * @return Void%0A     */%0A    self.bear =
+'s current bearing as an Array where the indices%0A     * represent the x and y offset, respectively.%0A     */%0A    self.__defineGetter(%22bearing%22,
  fun
@@ -3088,25 +3088,16 @@
 nction (
-direction
 ) %7B%0A    
@@ -3104,163 +3104,229 @@
     
-switch(direction) %7B
+return %5Bconfig.bearing%5B0%5D, config.bearing%5B1%5D%5D;%0A    %7D);%0A    
 %0A    
+/**%0A
      
-   case Bearing.NORTH:%0A            case Bearing.EAST:
+* Cause the player's bearing to shift 90 deg to the right.
 %0A     
- 
+*/%0A
     
-  case Bearing.SOUTH:%0A            case Bearing.WEST:%0A 
+self.bearRight = function () %7B%0A        var n = config.bearing.pop();%0A
         
     
@@ -3325,23 +3325,16 @@
     
-       
 config.b
 arin
@@ -3333,174 +3333,223 @@
 ig.b
+e
 aring
- = direction
+.unshift(n)
 ;%0A    
+%7D;%0A
     
+%0A
     
-    break;%0A            default:%0A                throw Error(%22Invalid direction given to Player.move(), '%22 + direction + %22'%22);%0A        %7D
+/**%0A     * Cause the player's bearing to shift 90 deg to the left.%0A     */%0A    self.bearLeft = function () %7B%0A        var n = config.bearing.shift();%0A        config.bearing.push(n);
 %0A   

Add bear left/right methods to player, change bearing format.