Loading BugChess.iml +9 −0 Changes for BugChess.iml: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -11,5 +11,14 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" name="io.vavr" level="project" /> <orderEntry type="library" name="alibaba.fastjson2" level="project" /> <orderEntry type="module-library"> <library> <CLASSES> <root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/annotations/23.0.0/annotations-23.0.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> </component> </module> No newline at end of file src/controller/ChessClickController.java +2 −5 Changes for src/controller/ChessClickController.java: 2 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -2,10 +2,7 @@ package controller; import model.History; import model.dataType.FlipStep; import model.dataType.GameType; import model.dataType.MoveStep; import model.dataType.Step; import model.dataType.*; import model.game.*; import network.Client; import view.ChessGameFrame; Loading Loading @@ -49,7 +46,7 @@ public enum ChessClickController { squareCom.repaint(); firstId = -1; } else { step = new MoveStep(firstId, square.id); step = square instanceof Chess ? new EatStep(firstId, square.id, -1) : new MoveStep(firstId, square.id); } } if(step != null){ Loading src/model/dataType/ChessColor.java +4 −0 Changes for src/model/dataType/ChessColor.java: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -22,4 +22,8 @@ public enum ChessColor { public Color getColor() { return color; } public ChessColor opponent(){ return this == BLACK ? RED : (this == RED ? BLACK : NONE); } } src/model/dataType/FlipStep.java +2 −1 Changes for src/model/dataType/FlipStep.java: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package model.dataType; import model.game.Chess; import model.game.Chessboard; import model.game.Game; /** * 记录一步行棋 Loading @@ -14,7 +15,7 @@ public class FlipStep extends Step { public final int srcChessId; public FlipStep(int srcChessId) { if (Chessboard.getInstance().getSquareById(srcChessId) instanceof Chess) { if (Game.instance.chessboard.getSquareById(srcChessId) instanceof Chess) { this.srcChessId = srcChessId; }else { throw new IllegalArgumentException(String.format( Loading src/model/dataType/MoveStep.java +3 −2 Changes for src/model/dataType/MoveStep.java: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package model.dataType; import model.game.Chess; import model.game.Chessboard; import model.game.Game; /** * 记录一步行棋 Loading @@ -19,8 +20,8 @@ public class MoveStep extends Step { public final int dstSquareId; public MoveStep(int srcChessId, int dstSquareId) { if (Chessboard.getInstance().getSquareById(srcChessId) instanceof Chess && !(Chessboard.getInstance().getSquareById(dstSquareId) instanceof Chess)) { if (Game.instance.chessboard.getSquareById(srcChessId) instanceof Chess && !(Game.instance.chessboard.getSquareById(dstSquareId) instanceof Chess)) { this.srcChessId = srcChessId; this.dstSquareId = dstSquareId; }else { Loading Loading
BugChess.iml +9 −0 Changes for BugChess.iml: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -11,5 +11,14 @@ <orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="library" name="io.vavr" level="project" /> <orderEntry type="library" name="alibaba.fastjson2" level="project" /> <orderEntry type="module-library"> <library> <CLASSES> <root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/annotations/23.0.0/annotations-23.0.0.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> </component> </module> No newline at end of file
src/controller/ChessClickController.java +2 −5 Changes for src/controller/ChessClickController.java: 2 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -2,10 +2,7 @@ package controller; import model.History; import model.dataType.FlipStep; import model.dataType.GameType; import model.dataType.MoveStep; import model.dataType.Step; import model.dataType.*; import model.game.*; import network.Client; import view.ChessGameFrame; Loading Loading @@ -49,7 +46,7 @@ public enum ChessClickController { squareCom.repaint(); firstId = -1; } else { step = new MoveStep(firstId, square.id); step = square instanceof Chess ? new EatStep(firstId, square.id, -1) : new MoveStep(firstId, square.id); } } if(step != null){ Loading
src/model/dataType/ChessColor.java +4 −0 Changes for src/model/dataType/ChessColor.java: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -22,4 +22,8 @@ public enum ChessColor { public Color getColor() { return color; } public ChessColor opponent(){ return this == BLACK ? RED : (this == RED ? BLACK : NONE); } }
src/model/dataType/FlipStep.java +2 −1 Changes for src/model/dataType/FlipStep.java: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package model.dataType; import model.game.Chess; import model.game.Chessboard; import model.game.Game; /** * 记录一步行棋 Loading @@ -14,7 +15,7 @@ public class FlipStep extends Step { public final int srcChessId; public FlipStep(int srcChessId) { if (Chessboard.getInstance().getSquareById(srcChessId) instanceof Chess) { if (Game.instance.chessboard.getSquareById(srcChessId) instanceof Chess) { this.srcChessId = srcChessId; }else { throw new IllegalArgumentException(String.format( Loading
src/model/dataType/MoveStep.java +3 −2 Changes for src/model/dataType/MoveStep.java: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ package model.dataType; import model.game.Chess; import model.game.Chessboard; import model.game.Game; /** * 记录一步行棋 Loading @@ -19,8 +20,8 @@ public class MoveStep extends Step { public final int dstSquareId; public MoveStep(int srcChessId, int dstSquareId) { if (Chessboard.getInstance().getSquareById(srcChessId) instanceof Chess && !(Chessboard.getInstance().getSquareById(dstSquareId) instanceof Chess)) { if (Game.instance.chessboard.getSquareById(srcChessId) instanceof Chess && !(Game.instance.chessboard.getSquareById(dstSquareId) instanceof Chess)) { this.srcChessId = srcChessId; this.dstSquareId = dstSquareId; }else { Loading