Beispiel #1
0
 public void DrawLine(int amountOfSymbols, string symbol, int step, Point2D.MoveDirection direction, Point2D point)
 {
     for (int i = 0; i < amountOfSymbols; i++)
     {
         DrawSymbolWithOffset(symbol, step, direction, point);
     }
 }
Beispiel #2
0
        private bool Condition(Point2D.MoveDirection moveDirection)
        {
            switch (moveDirection)
            {
            case Point2D.MoveDirection.Right:
            {
                return(currentPoint.XCoordinate != (this.startPoint.XCoordinate + this.SizeX - 1));
            }

            case Point2D.MoveDirection.Down:
            {
                return(currentPoint.YCoordinate != (this.startPoint.YCoordinate + this.SizeY - 1));
            }

            case Point2D.MoveDirection.Left:
            {
                return(currentPoint.XCoordinate != this.startPoint.XCoordinate);
            }

            case Point2D.MoveDirection.Up:
            {
                return(currentPoint.YCoordinate != this.startPoint.YCoordinate);
            }
            }
            return(false);
        }
Beispiel #3
0
        public void DrawBoardFragment(string corner, string symb, Point2D.MoveDirection direction, int lenght)
        {
            this.curveDrawer.DrawAt(corner, currentPoint.XCoordinate, currentPoint.YCoordinate);
            currentPoint.Move(direction, 1);
            bool condition = Condition(direction);

            while (condition)
            {
                this.curveDrawer.DrawLine(lenght - 1, symb, 1, direction, currentPoint);
                condition = Condition(direction);
            }
        }
Beispiel #4
0
 public void DrawSymbolWithOffset(string symbol, int step, Point2D.MoveDirection direction, Point2D currentPoint)
 {
     try
     {
         iOComponent.SetCursor(currentPoint.XCoordinate, currentPoint.YCoordinate);
         iOComponent.WriteOutput(symbol);
         currentPoint.Move(direction, step);
     }
     catch (ArgumentOutOfRangeException e)
     {
         iOComponent.Clear();
         iOComponent.WriteOutput(e.Message);
     }
 }