humanplayer.java
来自「一个黑白棋的源代码(尚未完成」· Java 代码 · 共 74 行
JAVA
74 行
/* * HumanPlayer.java * * Created on 2007-9-28, 16:01:01 * * To change this template, choose Tools | Templates * and open the template in the editor. */package org.yangcq.logic.player;import org.yangcq.logic.chessboard.IChessboard;import org.yangcq.logic.search.ISearcher;import org.yangcq.logic.step.Step;/** * * @author Administrator */public class HumanPlayer extends BasePlayer{ private boolean chessmanBlack; public boolean chess(IChessboard board, int x, int y) { if (board.getBoard()[x][y] == null) { board.getBoard()[x][y] = new Step(x, y, new Boolean(this.isChessmanBlack())); return true; } return false; } public boolean surrender(IPlayer player) { return true; //for test! } public boolean threaten(IPlayer player) { return true; //for test! } public boolean repent(IPlayer player) { return false; //for test! } public boolean isHumanPlayer() { return true; } public boolean isChessmanBlack() { return this.chessmanBlack; //for test! } public void setChessmanColor(boolean black) { this.chessmanBlack = black; } public void chess(IChessboard board) { throw new UnsupportedOperationException("Not supported yet."); } public void setAISearch(ISearcher searcher) { throw new UnsupportedOperationException("Not supported yet."); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?