📄 rootmove.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -