Commit 9949c2f9 authored by 刘家荣's avatar 刘家荣 💬
Browse files

bugfix: 修复窗口切换逻辑ChessFameFrame

parent 06ae2ccf
Loading
Loading
Loading
Loading
+23 −5
Original line number Diff line number Diff line
@@ -5,7 +5,9 @@ BugChess是一个在椰树精神的指导下开创的一个鲜榨项目,是一
***

## 项目配置

### 要求:

- jdk17环境
- IDEA或者其他IDE(以下以IDEA为例)

@@ -18,17 +20,32 @@ BugChess是一个在椰树精神的指导下开创的一个鲜榨项目,是一

test分支可以拿来练习VCS操作

## 第一轮迭代:

### 修bug

- bgm
- Form

## 第二轮迭代:

AI 联机 弹幕

### 提供接口

- J:
    - ChessClickController的AI的Timer,以及AI类的框架,猴子AI
    - AppController.connect, Client.connect,  
    - AppController.connect, Client.connect, OnlineStatus, C/S的SendMsg,
    - Room.roomList
    - OnlineInfo{ players, role, }
- Y:
  - 1
  -  (没有?)

### 编写代码

- J:
    - 1
    - AI ab剪枝算法
    - Client, Searcher, Server, Responser
- Y:
    - addBullet()
    - textArea's output(roomListPanel, actionHistory, scorePanel)
@@ -36,4 +53,5 @@ AI 联机 弹幕
    - roomFrame(选择 room 的 frame 或 panel)

### 合并和debug

随缘(
 No newline at end of file

src/Form1.form

0 → 100644
+53 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Form1">
  <grid id="27dc6" binding="RootPanel" layout-manager="GridBagLayout">
    <constraints>
      <xy x="20" y="20" width="500" height="400"/>
    </constraints>
    <properties/>
    <border type="none"/>
    <children>
      <component id="2bb93" class="javax.swing.JButton" binding="button1" custom-create="true" default-binding="true">
        <constraints>
          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
          <gridbag weightx="0.0" weighty="0.0"/>
        </constraints>
        <properties>
          <text value="Button"/>
        </properties>
      </component>
      <hspacer id="76e51">
        <constraints>
          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
          <gridbag weightx="0.0" weighty="0.0"/>
        </constraints>
      </hspacer>
      <vspacer id="55457">
        <constraints>
          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
          <gridbag weightx="0.0" weighty="0.0"/>
        </constraints>
      </vspacer>
      <component id="e4be" class="javax.swing.JTextField" binding="textField1" default-binding="true">
        <constraints>
          <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
            <preferred-size width="150" height="-1"/>
          </grid>
          <gridbag weightx="0.0" weighty="0.0"/>
        </constraints>
        <properties/>
      </component>
      <component id="1d617" class="javax.swing.JTextField" binding="textField2" default-binding="true">
        <constraints>
          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
            <preferred-size width="150" height="-1"/>
          </grid>
          <gridbag weightx="0.0" weighty="0.0"/>
        </constraints>
        <properties>
          <text value=""/>
        </properties>
      </component>
    </children>
  </grid>
</form>

src/Form1.java

0 → 100644
+13 −0
Original line number Diff line number Diff line
import javax.swing.*;

public class Form1 {
    private JButton button1;
    private JTextField textField1;
    private JTextField textField2;
    public JPanel RootPanel;
    
    private void createUIComponents() {
        button1 = new JButton("111");
        button1.addActionListener(e-> System.out.println("clicked"));
    }
}

src/Main2.java

0 → 100644
+11 −0
Original line number Diff line number Diff line
import javax.swing.*;

public class Main2 {
    public static void main(String[] args) {
        JFrame frame = new JFrame("Form1");
        frame.setContentPane(new Form1().RootPanel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -73,11 +73,13 @@ public class AppController {
                            Game.instance = new Game(true);
                            History.instance = new History(Game.instance.clone());
                        }
                        this.status = AppStatus.GAME;
                        SwingUtilities.invokeLater(() -> {
                            GameStartFrame.instance.setVisible(false);
                            ChessGameFrame.instance = new ChessGameFrame(620, 895);
                            ChessGameFrame.instance.setVisible(true);
                        });
                        break;
                }
                break;
            case ROOM:
@@ -97,11 +99,13 @@ public class AppController {
                            savedGame = null;
                            savedHistory = null;
                        }
                        this.status = AppStatus.START;
                        SwingUtilities.invokeLater(() -> {
                            ChessGameFrame.instance.setVisible(false);
                            GameStartFrame.instance = new GameStartFrame();
                            GameStartFrame.instance.setVisible(true);
                        });
                        break;
                    case ROOM:
                        break;
                    case GAME:
Loading