Loading .idea/inspectionProfiles/Project_Default.xml 0 → 100644 +8 −0 Changes for .idea/inspectionProfiles/Project_Default.xml: 8 added lines, 0 removed lines. Original line number Diff line number Diff line <component name="InspectionProjectProfileManager"> <profile version="1.0"> <option name="myName" value="Project Default" /> <inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true"> <option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,network.Server,newServerSocket" /> </inspection_tool> </profile> </component> No newline at end of file .idea/misc.xml +1 −1 Changes for .idea/misc.xml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ <property name="JTree.lineStyle" class="java.lang.String" /> </properties> </component> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17_PREVIEW" project-jdk-name="17" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> No newline at end of file BugChess.iml +9 −0 Changes for BugChess.iml: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -10,5 +10,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 README.md +10 −3 Changes for README.md: 10 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -55,6 +55,13 @@ AI 联机 弹幕 - 游戏界面的数据输出(player 和 visitor 的 list, 以及scores - roomFrame(选择 room 的 frame 或 panel) ### 合并和debug 随缘( No newline at end of file ### 合并和debug x1 - J - 修改Responser传递状态和人数 - AppController状态切换的拆分 - 错误检查 - 弹窗选择模式 - Y - RoomFrame 的 createRoom refresh - SideStack不显示的问题 No newline at end of file src/controller/AppController.java +54 −13 Changes for src/controller/AppController.java: 54 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -4,12 +4,11 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONException; import com.alibaba.fastjson2.JSONObject; import model.History; import model.dataType.GameType; import model.game.Game; import model.game.dataType.GameType; import view.Frame.AppFrame; import view.GameForm; import view.RoomsForm; import view.StartForm; import view.Frame.ChessGameFrame; import view.RoomFrame; import javax.swing.*; import java.awt.event.WindowAdapter; Loading Loading @@ -70,26 +69,67 @@ public class AppController { public void switchStatus(AppStatus status1, boolean useSave) { boolean success = true; //切换过程没有遇到任何问题阻止,哪里有问题就把它改成false switch (this.status) { case START: //从开始界面离开 SwingUtilities.invokeLater(() -> { AppFrame.instance.setVisible(false); }); switch (status1) { case START: break; //????????能进到这里的都不是一般人 case ROOM: //进入房间界面 SwingUtilities.invokeLater(() -> { RoomFrame.instance = new RoomFrame(); RoomFrame.instance.setVisible(true); }); break; case GAME: //进入游戏界面 SwingUtilities.invokeLater(() -> { ChessGameFrame.instance = new ChessGameFrame(); ChessGameFrame.instance.setVisible(true); }); if (useSave) { Game.instance = savedGame; History.instance = savedHistory; } else { Game.instance = new Game(GameType.LOCAL_2P); History.instance = new History(Game.instance.clone()); } break; } break; case ROOM: SwingUtilities.invokeLater(() -> { RoomFrame.instance.setVisible(false); }); switch (status1) { case START: SwingUtilities.invokeLater(() -> { AppFrame.instance = new AppFrame(); AppFrame.instance.setVisible(true); }); break; case ROOM: break; case GAME: case GAME: //进入游戏界面 SwingUtilities.invokeLater(() -> { ChessGameFrame.instance = new ChessGameFrame(); ChessGameFrame.instance.setVisible(true); }); if (useSave) { Game.instance = savedGame; History.instance = savedHistory; } else { Game.instance = new Game(GameType.LOCAL_2P, true); Game.instance = new Game(GameType.LOCAL_2P); History.instance = new History(Game.instance.clone()); } //TODO 传ip port 开Client break; } break; case ROOM: break; case GAME: SwingUtilities.invokeLater(() -> { RoomFrame.instance.setVisible(false); }); switch (status1) { case START: try { Loading @@ -112,15 +152,16 @@ public class AppController { } break; } AppFrame.instance.setContentPane(switch (status1){ case START -> new StartForm().rootPanel; case ROOM -> new RoomsForm().rootPanel; case GAME -> new GameForm().rootPanel; }); // AppFrame.instance.setContentPane(switch (status1){ // case START -> new StartForm().rootPanel; // case ROOM -> new RoomsForm().rootPanel; // case GAME -> new GameForm().rootPanel; // }); if (success) { this.status = status1; } } public void switchStatus(AppStatus status1) { this.switchStatus(status1, false); } Loading Loading
.idea/inspectionProfiles/Project_Default.xml 0 → 100644 +8 −0 Changes for .idea/inspectionProfiles/Project_Default.xml: 8 added lines, 0 removed lines. Original line number Diff line number Diff line <component name="InspectionProjectProfileManager"> <profile version="1.0"> <option name="myName" value="Project Default" /> <inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true"> <option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,network.Server,newServerSocket" /> </inspection_tool> </profile> </component> No newline at end of file
.idea/misc.xml +1 −1 Changes for .idea/misc.xml: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ <property name="JTree.lineStyle" class="java.lang.String" /> </properties> </component> <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="17" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_17_PREVIEW" project-jdk-name="17" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/out" /> </component> </project> No newline at end of file
BugChess.iml +9 −0 Changes for BugChess.iml: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -10,5 +10,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
README.md +10 −3 Changes for README.md: 10 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -55,6 +55,13 @@ AI 联机 弹幕 - 游戏界面的数据输出(player 和 visitor 的 list, 以及scores - roomFrame(选择 room 的 frame 或 panel) ### 合并和debug 随缘( No newline at end of file ### 合并和debug x1 - J - 修改Responser传递状态和人数 - AppController状态切换的拆分 - 错误检查 - 弹窗选择模式 - Y - RoomFrame 的 createRoom refresh - SideStack不显示的问题 No newline at end of file
src/controller/AppController.java +54 −13 Changes for src/controller/AppController.java: 54 added lines, 13 removed lines. Original line number Diff line number Diff line Loading @@ -4,12 +4,11 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONException; import com.alibaba.fastjson2.JSONObject; import model.History; import model.dataType.GameType; import model.game.Game; import model.game.dataType.GameType; import view.Frame.AppFrame; import view.GameForm; import view.RoomsForm; import view.StartForm; import view.Frame.ChessGameFrame; import view.RoomFrame; import javax.swing.*; import java.awt.event.WindowAdapter; Loading Loading @@ -70,26 +69,67 @@ public class AppController { public void switchStatus(AppStatus status1, boolean useSave) { boolean success = true; //切换过程没有遇到任何问题阻止,哪里有问题就把它改成false switch (this.status) { case START: //从开始界面离开 SwingUtilities.invokeLater(() -> { AppFrame.instance.setVisible(false); }); switch (status1) { case START: break; //????????能进到这里的都不是一般人 case ROOM: //进入房间界面 SwingUtilities.invokeLater(() -> { RoomFrame.instance = new RoomFrame(); RoomFrame.instance.setVisible(true); }); break; case GAME: //进入游戏界面 SwingUtilities.invokeLater(() -> { ChessGameFrame.instance = new ChessGameFrame(); ChessGameFrame.instance.setVisible(true); }); if (useSave) { Game.instance = savedGame; History.instance = savedHistory; } else { Game.instance = new Game(GameType.LOCAL_2P); History.instance = new History(Game.instance.clone()); } break; } break; case ROOM: SwingUtilities.invokeLater(() -> { RoomFrame.instance.setVisible(false); }); switch (status1) { case START: SwingUtilities.invokeLater(() -> { AppFrame.instance = new AppFrame(); AppFrame.instance.setVisible(true); }); break; case ROOM: break; case GAME: case GAME: //进入游戏界面 SwingUtilities.invokeLater(() -> { ChessGameFrame.instance = new ChessGameFrame(); ChessGameFrame.instance.setVisible(true); }); if (useSave) { Game.instance = savedGame; History.instance = savedHistory; } else { Game.instance = new Game(GameType.LOCAL_2P, true); Game.instance = new Game(GameType.LOCAL_2P); History.instance = new History(Game.instance.clone()); } //TODO 传ip port 开Client break; } break; case ROOM: break; case GAME: SwingUtilities.invokeLater(() -> { RoomFrame.instance.setVisible(false); }); switch (status1) { case START: try { Loading @@ -112,15 +152,16 @@ public class AppController { } break; } AppFrame.instance.setContentPane(switch (status1){ case START -> new StartForm().rootPanel; case ROOM -> new RoomsForm().rootPanel; case GAME -> new GameForm().rootPanel; }); // AppFrame.instance.setContentPane(switch (status1){ // case START -> new StartForm().rootPanel; // case ROOM -> new RoomsForm().rootPanel; // case GAME -> new GameForm().rootPanel; // }); if (success) { this.status = status1; } } public void switchStatus(AppStatus status1) { this.switchStatus(status1, false); } Loading