Bug 235

Summary: Incorrect position information of initializtion
Product: CS3343 group25 chess game Reporter: Andy <dotafterfootball>
Component: chess gameAssignee: HUANG Xiaofeng <xhuang227-c>
Status: CONFIRMED ---    
Severity: enhancement    
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Mac OS   

Description Andy 2017-11-30 10:09:05 HKT
public boolean upgrade(int role, int x, int y, int target_x, int target_y) {
		switch (role){
		case 1:
			theChessBoard.initialize(target_x, target_y, new Knight(theChessBoard.getPiece(x, y).getColor(),"1"));
			return true;
		case 2:
			theChessBoard.initialize(target_x, target_y, new Bishop(theChessBoard.getPiece(x, y).getColor(),"1"));
			return true;
		case 3:
			theChessBoard.initialize(target_x, target_y, new Rook(theChessBoard.getPiece(x, y).getColor(),"1"));
			return true;
		case 4:
			theChessBoard.initialize(target_x, target_y, new Queen(theChessBoard.getPiece(x, y).getColor(),"1"));
			return true;
		default:
			return false;
		}
	}

This step is behind the move action, so theChessBoard.getPiece(x, y) should be theChessBoard.getPiece(target_x, target_y)