 				@importFEN( "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" )
 
 	getMoves: (x, y) ->
-		(@get(x,y)).getMoves(x, y, @board)
+		(@get(x,y)).getMoves( x, y, this )
 
 	test: ->
 		@board =

myGame.setup("classic")
#myGame.test()
myGame.log()
myGame.getMoves(0,1)
#console.log myGame.get(1,2)
#console.log myGame.get("a1")
#

	blackSymbol: "\u265F"
	whiteSymbol: "\u2659"

	getMoves: (x,y,game) ->
		moves = []
		# White.
		if @color == 'white'
			# Default move.
			if y+1 < 8 and game.get( x, y+1 ) instanceof BlankPiece
				moves.push( [x,y+1] )
				# Double step.
				if y == 1 and y+2 < 8 and game.get( x, y+2 ) instanceof BlankPiece
					moves.push( [x,y+2] )
			# TODO: Attack available.
		# Black.
		else
			# Default move.
			if y-1 >= 0 && game.get( x, y-1 ) instanceof BlankPiece
				moves.push( [x,y-1] )
				# Double step.
				if y == 6 && y-2 >= 0 && game.get( x, y-2 ) instanceof BlankPiece
					moves.push( [x,y-2] )
			# TODO: Attack available.
		i = 0
		while i < moves.length
			console.log( moves[i] )
			i++
		return moves

class Knight extends Piece
