예제 #1
0
 private bool ErrorPosition(string position, IBoardManager boardManager)
 {
     if (!boardManager.GetPosition(position).GetFigure())
     {
         Errors.Push($"Вы выбрали пустую клетку");
         return(true);
     }
     return(false);
 }
예제 #2
0
        public ErrorInputTextСhecking(string inputText, ref IBoardManager boardManager)
        {
            Errors = new Stack <string>();
            if (inputText.Equals(""))
            {
                Errors.Push("Впишите команду"); return;
            }
            string[] positions = inputText.Split(':');

            ErrorCountPosition(inputText);
            if (ErrorСheckingPositions(positions))
            {
                return;
            }
            if (ErrorPosition(positions[0], boardManager))
            {
                return;
            }
            ErrorMove(boardManager.GetPosition(inputText.Split(':')[0]), boardManager.GetPosition(inputText.Split(':')[1]));
        }