private BoardStateBase Clone() { var myLinesClone = new List <Line>(MyLines.Select(l => l.Clone())); var oppLinesClone = new List <Line>(OppLines.Select(l => l.Clone())); return(new BoardStateBase(myLinesClone, oppLinesClone, MyCellType, (BoardCell[, ])Board.Clone())); }
private IEnumerable <Cell> GetImmidiateThreatCells() { var threatOfFour = OppLines.Where(l => Game.ThreatOfFour(l.Estimate(Board, Opponent))).ToList(); foreach (var cell in GetThreatCells(threatOfFour)) { yield return(cell); } ////if (threatOfFour.Any()) yield break; ////var oppThreatOfThree = OppLines.Where(l => Game.ThreatOfThree(l.Estimate(Board, Opponent))).ToList(); ////if (oppThreatOfThree.Any()) ////{ //// foreach (var cell in GetThreatCells(oppThreatOfThree)) yield return cell; //// var myThreatOfFour = MyLines.Where(l => l.Estimate(Board, Type) == LineType.BlokedThree); //// foreach (var cell in GetThreatCells(myThreatOfFour)) yield return cell; //// var myThreatOfThree = MyLines.Where(l => Game.ThreatOfThree(l.Estimate(Board, Type))); //// foreach (var cell in GetThreatCells(myThreatOfThree)) yield return cell; ////} }