Пример #1
0
 public void Move()
 {
     if (orientation == orintation.left)
     {
         if (CanMakeMove(x - 1, y) == string.Empty)
         {
             MoveLeft();
         }
         else
         {
             orientation = orintation.right;
         }
     }
     else if (orientation == orintation.right)
     {
         if (CanMakeMove(x + 1, y) == string.Empty)
         {
             MoveRight();
         }
         else
         {
             orientation = orintation.left;
         }
     }
     else if (orientation == orintation.top)
     {
         if (CanMakeMove(x, y - 1) == string.Empty)
         {
             MoveUp();
         }
         else
         {
             orientation = orintation.down;
         }
     }
     else if (orientation == orintation.down)
     {
         if (CanMakeMove(x, y + 1) == string.Empty)
         {
             MoveDown();
         }
         else
         {
             orientation = orintation.top;
         }
     }
 }
Пример #2
0
 public PrintableMovableBarrier(int x, int y, ConsoleColor color, Board board, orintation orientation) : base(x, y, color, board)
 {
     this.orientation = orientation;
 }