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

📄 readytoplay.java

📁 用jav语言开发的基于J2SE平台的中国象棋.供大家参考和学习
💻 JAVA
字号:
/*
 * 创建日期 2005-3-18
 *
 * 更改所生成文件模板为
 * 窗口 > 首选项 > Java > 代码生成 > 代码和注释
 */
package chinesechess.main;

/**
 * @author Administrator
 *
 * 更改所生成类型注释的模板为
 * 窗口 > 首选项 > Java > 代码生成 > 代码和注释
 */
public class ReadyToPlay {
	private boolean connectionReady;
	private boolean timeRuleReady;
	private boolean sysCfgReady;
	private int negotiateTimes;
	
	public ReadyToPlay(){
		connectionReady = false;
		timeRuleReady = false;
		sysCfgReady = false;
		negotiateTimes = 3;
	}
	public ReadyToPlay(boolean connected, boolean timeagree){
		connectionReady = connected;
		negotiateTimes = 2;
		timeRuleReady = timeagree;
	}

	public boolean isConnectionReady() {
		return connectionReady;
	}

	public boolean isTimeRuleReady() {
		return timeRuleReady;
	}

	public void setConnectionReady(boolean b) {
		connectionReady = b;
	}

	public void setTimeRuleReady(boolean b) {
		timeRuleReady = b;
	}
	
	public void negotiateTimeRule() 
		throws CannotGetAgreeOnMoreThanThreeTimes{
		if(negotiateTimes > 0 )
			negotiateTimes -- ;
		else
			throw new CannotGetAgreeOnMoreThanThreeTimes();
	}
	
	public boolean canPlay(){
		return connectionReady && timeRuleReady && sysCfgReady;
	}
	
	public boolean isSysCfgReady() {
		return sysCfgReady;
	}

	public void setSysCfgReady(boolean b) {
		sysCfgReady = b;
	}

}

⌨️ 快捷键说明

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