public static int LibertyCountAfterMove(GoBoard goBoard, Color player, int move) { if (!goBoard.GetColor(move).IsEmpty) { return(0); // invalid } if (goBoard.IsSuicide(move, player)) { return(0); } goBoard.PlayStone(move, player, true); int lLiberities = goBoard.GetBlockLibertyCount(move); goBoard.Undo(); return(lLiberities); }
public static int LibertyCount(GoBoard goBoard, Color player, PatternFunctionParameters <int> parameters) { return(goBoard.GetBlockLibertyCount(parameters[0])); }
public static int LibertyCountAfterMove(GoBoard goBoard, Color player, int move) { if (!goBoard.GetColor(move).IsEmpty) return 0; // invalid if (goBoard.IsSuicide(move, player)) return 0; goBoard.PlayStone(move, player, true); int lLiberities = goBoard.GetBlockLibertyCount(move); goBoard.Undo(); return lLiberities; }
public static int LibertyCount(GoBoard goBoard, Color player, PatternFunctionParameters<int> parameters) { return goBoard.GetBlockLibertyCount(parameters[0]); }