rootmove.java
来自「ErGo是一个很早的Java通用围棋服务器(IGS/NNGS)客户端程序。有全部」· Java 代码 · 共 56 行
JAVA
56 行
package ergo.logic;
// $Id: RootMove.java,v 1.2 1999/08/13 01:17:49 sigue Exp $
/*
* Copyright (C) 1999 Carl L. Gay and Antranig M. Basman.
* See the file copyright.txt, distributed with this software,
* for further information.
*/
import ergo.util.*;
import java.io.PrintWriter;
// There should only be one instance of this class per game.
// The root move is just used for holding variations on the first
// move of the game.
public final class RootMove extends Move {
RootMove () {
// super(parent, timeleft, moveNumber, color, isVariation)
super(null, 0, -1, Move.WHITE, false);
}
public String toString () { return "---"; }
public PositionVector placedPositions (int x) { return null; }
// I don't think this will ever be called for the root move.
public boolean isLegal (Game g, boolean fast, ILMV result) {
if (parent == null)
return true;
else {
result.failureReason = "The root move cannot have a parent.";
return false;
}
}
public void commit () {
}
public boolean equals (Move m) { return m == this; }
public SimpleGroupVector capturedGroups () {
return null;
}
public int numberOfStones () { return 0; }
public boolean occupiesPosition (Position pos) {
return false;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?