mirror of
				https://github.com/lov3b/Schack.git
				synced 2025-11-03 22:50:24 +01:00 
			
		
		
		
	Update Board.java
This commit is contained in:
		@@ -128,7 +128,7 @@ public class Board extends JPanel implements MouseListener {
 | 
				
			|||||||
                ArrayList<Point> opposingAttacks = checkAttacks(!whitesTurn);
 | 
					                ArrayList<Point> opposingAttacks = checkAttacks(!whitesTurn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                boolean weCanMove = allValidMoves.size() > 0;
 | 
					                boolean weCanMove = allValidMoves.size() > 0;
 | 
				
			||||||
                boolean isPatt = false;
 | 
					                boolean inSchack = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                for (Point attack : opposingAttacks) {
 | 
					                for (Point attack : opposingAttacks) {
 | 
				
			||||||
                    Piece attacked = pieces[attack.x][attack.y];
 | 
					                    Piece attacked = pieces[attack.x][attack.y];
 | 
				
			||||||
@@ -142,10 +142,10 @@ public class Board extends JPanel implements MouseListener {
 | 
				
			|||||||
                        } else {
 | 
					                        } else {
 | 
				
			||||||
                            JOptionPane.showMessageDialog(this, "Schackmatt");
 | 
					                            JOptionPane.showMessageDialog(this, "Schackmatt");
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        isPatt = true;
 | 
					                        inSchack = true;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                if (!isPatt && !weCanMove) {
 | 
					                if (!inSchack && !weCanMove) {
 | 
				
			||||||
                    JOptionPane.showMessageDialog(this, "Patt");
 | 
					                    JOptionPane.showMessageDialog(this, "Patt");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user