⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chessstate.java

📁 SWT实现人人的象棋程序 供学习SWT的同志做个参考
💻 JAVA
字号:
package com.catking.Utility;
import com.catking.chess.*;

//对一个棋子的状态进行建模
//实现undo方法

public class ChessState {
	//被占领的棋子
	public Chess chess;
	public int x;		//原来棋子的位置
	public int y;
	public boolean myBossSafe;			//移动前双方老将是否被将
	public boolean hisBossSafe;
	
	//记录了一个棋子的原来位置,以及侵占的棋子
	public ChessState(Chess chess, int x, int y, 
					boolean myBossSafe, boolean hisBossSafe){
		this.chess = chess;
		this.x = x;
		this.y = y;
		this.myBossSafe = myBossSafe;
		this.hisBossSafe = hisBossSafe;
	}

}

⌨️ 快捷键说明

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