public void MoveFigure(ChessFigurePosition position1, ChessFigurePosition position2)
 {
     this[position2] = this[position1];
     this[position1] = ChessFigure._;
 }
 public void DeleteFigure(ChessFigurePosition position)
 {
     if (this[position] != ChessFigure._)
     {
         this[position] = ChessFigure._;
     }
     else {
         throw new InvalidOperationException("There are no chess figures at this position.");
     }
 }
 public void CreateFigure(ChessFigurePosition position, ChessFigure figure)
 {
     if (this[position] == ChessFigure._)
     {
         this[position] = figure;
     }
     else {
         throw new InvalidOperationException("There's a chess figure at this position.");
     }
 }
 public ChessFigure this[ChessFigurePosition position]
 {
     get
     {
         return Array[position.Column - ChessFigurePosition.MIN_COLUMN, position.Row - ChessFigurePosition.MIN_ROW];
     }
     set
     {
         Array[position.Column - ChessFigurePosition.MIN_COLUMN, position.Row - ChessFigurePosition.MIN_ROW] = value;
     }
 }
 public void MoveFigure(ChessFigurePosition position1, ChessFigurePosition position2,string a,string b)
 {
     networking.MoveFigure(a, b);
     board.MoveFigure(position1, position2);
 }
 // Передвигает фигуру с одной клетки на другую
 void move(string args)
 {
     string[] positions = args.Split(new char[] { ' ', '\t', '-' }, StringSplitOptions.RemoveEmptyEntries);
     if (positions.Length != 2)
         SafePrint(@"Incorrect format. Try something like ""e2-e4"".");
     else {
         ChessFigurePosition tmp1 = new ChessFigurePosition(positions[0]);
         ChessFigurePosition tmp2 = new ChessFigurePosition(positions[1]);
         if (gameData.Board[tmp1] == ChessFigure._) {
             SafePrint("Cant move a non-existent figure.");
             return;
         }
         if (positions[0] == positions[1]) {
             SafePrint("You can't move yourself.");
             return;
         }
         gameData.MoveFigure(tmp1, tmp2, positions[0], positions[1]);
         print(args);
     }
 }