chesspoint.java

来自「中国象棋打谱系统」· Java 代码 · 共 65 行

JAVA
65
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package 中国象棋打谱系统;/** * * @author Administrator */public class ChessPoint{   int x,y;   boolean 有棋子;   ChessPiece piece=null;   ChessBoard board=null;   public ChessPoint(int x,int y,boolean boo)   {      this.x=x;      this.y=y;      有棋子=boo;   }  public boolean isPiece()  {    return 有棋子;  }  public void set有棋子(boolean boo)  {    有棋子=boo;  }   public int getX()  {    return x;  }  public int getY()  {    return y;  }  public void setPiece(ChessPiece piece,ChessBoard board)  {     this.board=board;     this.piece=piece;     board.add(piece);     int w=(board.unitWidth);     int h=(board.unitHeight);     piece.setBounds(x-w/2,y-h/2,w,h);     有棋子=true;     board.validate();   }  public ChessPiece getPiece()  {     return piece;  }  public void reMovePiece(ChessPiece piece,ChessBoard board)  {     this.board=board;     this.piece=piece;     board.remove(piece);     board.validate();     有棋子=false;  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?