/// <summary> /// Constructor /// </summary> /// <param name="move"> Move position</param> public MoveSelectedEventArgs(ChessBoard.MovePosS move) { Move = move; }
//********************************************************* // /// <summary> /// Convert a list of PGN positions into a moving positions /// </summary> /// <param name="eColorToPlay"> Color to play</param> /// <param name="arrRawMove"> Array of PGN moves</param> /// <param name="piMoveList"> Returned array of moving position</param> /// <param name="listMovePos"> Returned the list of move if not null</param> /// <param name="iSkip"> Skipped count</param> /// <param name="iTruncated"> Truncated count</param> // //********************************************************* private void CnvRawMoveToPosMove(ChessBoard.PlayerColorE eColorToPlay, List<string> arrRawMove, out int[] piMoveList, List<ChessBoard.MovePosS> listMovePos, ref int iSkip, ref int iTruncated) { List<int> arrMoveList; ChessBoard.MovePosS movePos; int iPos; movePos = new ChessBoard.MovePosS(); movePos.StartPos = 0; movePos.EndPos = 0; movePos.Type = ChessBoard.MoveTypeE.Normal; arrMoveList = new List<int>(256); try { foreach (string strMove in arrRawMove) { if (strMove == "1-0" || strMove == "0-1" || strMove == "1/2-1/2" || strMove == "*" || strMove[0] == '(') { break; } else if (strMove == "..") { iSkip++; break; } CnvRawMoveToPosMove(eColorToPlay, strMove, out iPos, ref iTruncated, ref movePos); if (iPos != -1) { arrMoveList.Add(iPos); if (listMovePos != null) { listMovePos.Add(movePos); } eColorToPlay = (eColorToPlay == ChessBoard.PlayerColorE.Black) ? ChessBoard.PlayerColorE.White : ChessBoard.PlayerColorE.Black; } else { break; } } } catch(PgnParserException ex) { ex.MoveList = arrMoveList.ToArray(); throw ex; } piMoveList = arrMoveList.ToArray(); }