fixed waiting piece move bug
This commit is contained in:
		@@ -85,7 +85,7 @@ public Game() {
 | 
			
		||||
        gameStatistics = new Statistic();
 | 
			
		||||
        initializeDrawPile();
 | 
			
		||||
        board = new Board();
 | 
			
		||||
        die = new Die(2,1,2,2,1,3);
 | 
			
		||||
        die = new Die(2,5,6,3,6);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -348,4 +348,13 @@ public void setPieceInHome(int index, Piece piece) {
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return "Player: " + name + " Color: " + color;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void removeWaitingPiece(Piece piece) {
 | 
			
		||||
        for (int i = 0; i < Resources.MAX_PIECES; i++) {
 | 
			
		||||
            if (piece.equals(this.waitingArea[i])) {
 | 
			
		||||
                this.waitingArea[i] = null;
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -40,6 +40,7 @@ public void enter() {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void received(RequestMoveMessage msg, int from){
 | 
			
		||||
        if (msg.getPiece().equals(this.piece)) {
 | 
			
		||||
            logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).removeWaitingPiece(this.piece);
 | 
			
		||||
            piece.setState(PieceState.ACTIVE);
 | 
			
		||||
            Piece thrownOcc = logic.getGame().getBoard().getInfield()[logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()).getStartNodeIndex()].getOccupant();
 | 
			
		||||
            if (thrownOcc != null) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user