Skip to content

Commit

Permalink
加了悔棋
Browse files Browse the repository at this point in the history
  • Loading branch information
YanfYanggg committed Dec 22, 2022
1 parent dd7ab3d commit 065729e
Show file tree
Hide file tree
Showing 18 changed files with 531 additions and 534 deletions.
Empty file removed Texts/regret.txt
Empty file.
12 changes: 0 additions & 12 deletions Texts/saveGame.txt

This file was deleted.

Binary file modified out/production/DarkChess-master/controller/ClickController.class
Binary file not shown.
Binary file modified out/production/DarkChess-master/controller/GameController.class
Binary file not shown.
Binary file modified out/production/DarkChess-master/view/ChessGameFrame.class
Binary file not shown.
Binary file modified out/production/DarkChess-master/view/Chessboard.class
Binary file not shown.
12 changes: 12 additions & 0 deletions recordByStep/0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
b0 A0 A0 f0
D0 C0 F0 a0
a0 D0 d0 g0
a0 A0 B0 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
1
Black is the next
0
0
18 changes: 9 additions & 9 deletions recordByStep/1.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E0 a0 e0
A0 A0 C1 F0
c0 c0 G0 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
b0 A0 A0 f0
D0 C0 F0 a0
a1 D0 d0 g0
a0 A0 B0 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
1
Black is the next
Red is the next
0
0
18 changes: 9 additions & 9 deletions recordByStep/2.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E0 a1 e0
A0 A0 C1 F0
c0 c0 G0 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
b0 A0 A0 f0
D0 C0 F0 a0
a1 D0 d1 g0
a0 A0 B0 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
2
Red is the next
Black is the next
0
0
18 changes: 9 additions & 9 deletions recordByStep/3.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E0 a1 e1
A0 A0 C1 F0
c0 c0 G0 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
b0 A0 A0 f0
D0 C0 F0 a0
a1 D0 d1 g0
a0 A0 B1 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
2
Black is the next
Red is the next
0
0
18 changes: 9 additions & 9 deletions recordByStep/4.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E0 a1 e1
A0 A0 C1 F1
c0 c0 G0 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
b0 A0 A0 f0
D0 C1 F0 a0
a1 D0 d1 g0
a0 A0 B1 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
3
Red is the next
Black is the next
0
0
20 changes: 10 additions & 10 deletions recordByStep/5.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E0 C1 e1
A0 A0 em F1
c0 c0 G0 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
b0 A0 A0 f0
D0 C1 F0 a0
a1 D1 d1 g0
a0 A0 B1 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
3
Black is the next
1
Red is the next
0
0
20 changes: 10 additions & 10 deletions recordByStep/6.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E0 C1 e1
A0 A1 em F1
c0 c0 G0 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
b0 A0 A0 f0
D0 C1 F0 a0
a1 D1 d1 g0
a0 A1 B1 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
4
Red is the next
1
Black is the next
0
0
20 changes: 10 additions & 10 deletions recordByStep/7.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E1 C1 e1
A0 A1 em F1
c0 c0 G0 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
b0 A0 A0 f0
D0 C1 F0 a0
a1 D1 d1 g0
a1 A1 B1 d0
e0 a0 A0 e0
G0 F0 E0 a0
f0 b0 C0 A0
E0 c0 c0 B0
4
Black is the next
1
Red is the next
0
0
20 changes: 10 additions & 10 deletions recordByStep/8.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
F0 b0 A0 B0
D0 f0 a0 D0
a0 E1 C1 e1
A0 A1 em F1
c0 c0 G1 d0
d0 E0 C0 A0
f0 a0 b0 e0
B0 A0 a0 g0
G0 a0 e0 f0
C0 D0 E0 B0
B0 d1 E1 A1
D0 em A1 F0
c0 a1 b0 c0
a0 d0 F0 C0
b0 g0 a0 A0
f0 a0 e0 A0
5
Red is the next
1
0
0
1
9 changes: 2 additions & 7 deletions src/controller/GameController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class GameController {
public GameController(Chessboard chessboard) {
this.chessboard = chessboard;
}

//这个方法是写 如何从文件中读取数据 !! sakai第介绍38分钟 我没有改这个方法,存档
public List<String> loadGameFromFile(String path) {
try {
List<String> chessData = Files.readAllLines(Path.of(path));
Expand Down Expand Up @@ -125,17 +123,14 @@ public List<String> loadGameFromFile(String path) {
//悔棋

public void regret(){
if (chessboard.step>1){
if (chessboard.step>0){
chessboard.step--;
loadGameFromFile(String.format("recordByStep/%d.txt",chessboard.step));
}else{
//弹出已是第一步了,不能再悔棋了
}

}

public void restartGame() {
chessboard.step=1;
chessboard.step=0;
Menu.chessGameFrame = new ChessGameFrame(720, 720);

}
Expand Down
Loading

0 comments on commit 065729e

Please sign in to comment.