Commit 321c653e authored by YuFan Jia's avatar YuFan Jia 💤
Browse files

feat( ):

parent b45d0738
Loading
Loading
Loading
Loading

.vscode/settings.json

0 → 100644
+5 −0
Original line number Diff line number Diff line
{
    "java.project.referencedLibraries": [
        "lib/**/*.jar"
    ]
}
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
@@ -145,6 +145,17 @@ public class ChessBoardPanel extends JPanel {
                }
            }
        }
        int flag = 0;
        for (int i = 0; i < digitBoard.length; i++) {
            for (int j = 0; j < digitBoard.length; j++) {
                if (digitBoard[i][j] != 0) {
                    flag++;
                }
            }
        }
        if (flag == 64) {
            return true;
        }
        return true;
    }

+22 −1
Original line number Diff line number Diff line
@@ -8,10 +8,16 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import javax.swing.JOptionPane;
import javax.swing.plaf.OptionPaneUI;

import java.io.FileNotFoundException;

import Components.ChessBoardPanel;
import GameUI.BasicBackground;
import GameUI.ChessGameUI;
import GameUI.OpinionPanel;
import GameUI.StatusUI;
import GameUI.TopBar;
import Model.CheatStatus;
@@ -152,7 +158,22 @@ public class GameCore {
    public boolean checkGameOver() {// 检测下完没 内部有调用checkWinner 这个每一次点击都会执行
        if (this.gamePanel.isGameOver(currentPlayer)) {
            System.out.println("gg");
            checkWinner();
            ChessPiece winner = checkWinner();
            String winPlayer = null;
            if (winner == ChessPiece.EMPTY) {
                winPlayer = "Nobody";
            } else {
                winPlayer = winner.toString();
            }
            OpinionPanel showWinner = new OpinionPanel(winPlayer + " win, press ok to restart game", "Game over",
                    JOptionPane.OK_CANCEL_OPTION);
            if (showWinner.clickYes()) {
                restart();
            } else {
                BasicBackground.backFrame.remove(BasicBackground.thisChessGameUI);
                BasicBackground.changePanel(BasicBackground.thisStartMenuUI);
            }

        } else {
            System.out.println("continue");
        }
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ import javax.swing.JOptionPane;
public class OpinionPanel extends JOptionPane {
    private int flag;

    OpinionPanel(String word, String title, int buttonType) {
    public OpinionPanel(String word, String title, int buttonType) {
        flag = showConfirmDialog(null, word, title, buttonType);
    }

lib/beautyeye_lnf.jar

0 → 100644
+524 KiB

File added.

No diff preview for this file type.

Loading