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

📄 passmove.java

📁 ErGo是一个很早的Java通用围棋服务器(IGS/NNGS)客户端程序。有全部源码和文档
💻 JAVA
字号:
package ergo.logic;

// $Id: PassMove.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;

public class PassMove extends Move {

  public PassMove(Move parent, int timeleft, int num, int color, boolean isVar) {
    super(parent, timeleft, num, color, isVar);
  }

  public String toString () { return "Pass"; }

  public PositionVector placedPositions (int x) {
    return null;
  }

  public void link () {
    // The server sends pass moves to observers for each group removed
    // during the scoring phase of the game.  I don't want to store all
    // those in the game file, so try not to link them in.  I think it
    // should be ok to not link in any pass moves after there have been
    // three in a row.
    if (!(parent instanceof PassMove
	  && parent.parent() instanceof PassMove
	  && parent.parent().parent() instanceof PassMove))
      super.link();
  }

  public SimpleGroupVector capturedGroups () {
    return null;
  }

  public int numberOfStones () { return 0; }

  public boolean equals (Move m) {
    return (m instanceof PassMove);
  }

  public void writeSGF (PrintWriter out, Game game, int n) {
    if (!(parent instanceof RootMove))
      out.print(";");
    out.print(((color == BLACK) ? "B" : "W") + "[]");
    if (game.isNetGame())
      writeTimeLeft(out);
    super.writeSGF(out, game, n);
  }

  public boolean occupiesPosition (Position pos) {
    return false;
  }
}				// end class PassMove

⌨️ 快捷键说明

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