public bool IsProtectedLiberty(int point) { // protected liberites are liberties that should not be played by the opponent // because of suicide or being directly capturable return(Board.IsProtectedLiberty(point, Defender)); }
public static bool FindMovesInProtectedAreas(GoBoard goBoard, Color currentPlayer, int currentMove, Color nextPlayer, int nextMove) { if (nextPlayer == Color.Empty) { return(false); } if ((nextMove == CoordinateSystem.PASS) || (nextMove == CoordinateSystem.RESIGN)) { return(false); } return(goBoard.IsProtectedLiberty(nextMove, nextPlayer)); }
// marked to be depreciated private List <int> _GetProtectedLiberites(Color color) { List <int> lProtected = new List <int>(); for (int lIndex = 0; lIndex < Board.Coord.BoardArea; lIndex++) { if (Board.IsProtectedLiberty(lIndex, color)) { lProtected.Add(lIndex); } } return(lProtected); }
public static List <int> GetProtectedLiberites(GoBoard goBoard, Color color) { List <int> lProtected = new List <int>(); for (int lIndex = 0; lIndex < goBoard.Coord.BoardArea; lIndex++) { if (goBoard.IsProtectedLiberty(lIndex, color)) { lProtected.Add(lIndex); } } return(lProtected); }
public static List <int> GetNeighborsOfProtectedLiberites(GoBoard goBoard, Color color) { List <int> lNeighbors = new List <int>(); for (int lPoint = 0; lPoint < goBoard.Coord.BoardArea; lPoint++) { if (goBoard.IsProtectedLiberty(lPoint, color)) { foreach (int lNeighbor in goBoard.Coord.GetNeighbors(lPoint)) { if (!lNeighbors.Contains(lNeighbor)) { lNeighbors.Add(lNeighbor); } } } } return(lNeighbors); }
public static List<int> GetProtectedLiberites(GoBoard goBoard, Color color) { List<int> lProtected = new List<int>(); for (int lIndex = 0; lIndex < goBoard.Coord.BoardArea; lIndex++) if (goBoard.IsProtectedLiberty(lIndex, color)) lProtected.Add(lIndex); return lProtected; }
public static List<int> GetNeighborsOfProtectedLiberites(GoBoard goBoard, Color color) { List<int> lNeighbors = new List<int>(); for (int lPoint = 0; lPoint < goBoard.Coord.BoardArea; lPoint++) if (goBoard.IsProtectedLiberty(lPoint, color)) foreach (int lNeighbor in goBoard.Coord.GetNeighbors(lPoint)) if (!lNeighbors.Contains(lNeighbor)) lNeighbors.Add(lNeighbor); return lNeighbors; }
public static bool FindMovesInProtectedAreas(GoBoard goBoard, Color currentPlayer, int currentMove, Color nextPlayer, int nextMove) { if (nextPlayer == Color.Empty) return false; if ((nextMove == CoordinateSystem.PASS) || (nextMove == CoordinateSystem.RESIGN)) return false; return (goBoard.IsProtectedLiberty(nextMove, nextPlayer)); }