?? chesspoint.java
字號:
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;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -