public MoveRepresentation GetClone() { MoveRepresentation result = new MoveRepresentation(null); result.m_BoardPattern = new int[m_BoardPattern.Length]; for (int i = 0; i < m_BoardPattern.Length; i++) { result.m_BoardPattern[i] = m_BoardPattern[i]; } result.m_Move = BgMove.CloneFromFirst(m_Move.FirstMove); result.m_Score = m_Score; return(result); }
private void GenerateMoves(BgMoveList moveList, BgMove prevMove) { BgMoveList singleMoves = FindAllSingleMoves(); if (singleMoves.Count() > 0) { for (int i = 0; i < singleMoves.Count(); i++) { BgMove currentMove = new BgMove(singleMoves.GetBgMove(i).From, singleMoves.GetBgMove(i).To, prevMove); m_BgGame.MakeMove(currentMove.From, currentMove.To); GenerateMoves(moveList, currentMove); m_BgGame.Undo(); } } else { if (prevMove != null) { moveList.AddBgMove(BgMove.CloneFromFirst(prevMove.FirstMove)); } } }