Пример #1
0
        private void DrawDirection(
            Graphics gc,
            PointDrawingHelper drawingHelper,
            LazerEntity lazer)
        {
            var rectangle = drawingHelper.GetPointRectangle();
            var point1    = drawingHelper.GetCentrePoint();
            var point2    = drawingHelper.GetLazerDirectionPoint(lazer.GlowDirection);

            gc.DrawLine(this._redPen, point1, point2);
        }
Пример #2
0
        private void DrawMainRectangle(
            Graphics gc,
            PointDrawingHelper helper)
        {
            Condition.Requires(gc, nameof(gc)).IsNotNull();
            Condition.Requires(helper, nameof(helper)).IsNotNull();

            var mainRectangle = helper.GetPointRectangle();

            gc.FillEllipse(this._blackBrush, mainRectangle);
        }
Пример #3
0
        private void DrawMainBlueCircle(
            Graphics gc,
            PointDrawingHelper drawingHelper,
            LazerEntity lazer)
        {
            var rectangle = drawingHelper.GetPointRectangle();

            gc.FillEllipse(
                this.GetMainBrush(lazer.State),
                rectangle);
        }
Пример #4
0
        private void DrawOutline(
            Graphics gc,
            PointDrawingHelper helper)
        {
            Condition.Requires(gc, nameof(gc)).IsNotNull();
            Condition.Requires(helper, nameof(helper)).IsNotNull();

            gc.DrawRectangle(
                _outlinePen,
                helper.GetPointRectangle(offsetFromSide: 1));
        }
Пример #5
0
        private void DrawBackground(
            Graphics gc,
            PointDrawingHelper helper)
        {
            Condition.Requires(gc, nameof(gc)).IsNotNull();
            Condition.Requires(helper, nameof(helper)).IsNotNull();

            gc.FillRectangle(
                _backgroundBrush,
                helper.GetPointRectangle());
        }
Пример #6
0
        private void DrawWickRectangle(
            BombEntity bomb,
            Graphics gc,
            PointDrawingHelper helper)
        {
            Condition.Requires(bomb, nameof(bomb)).IsNotNull();
            Condition.Requires(gc, nameof(gc)).IsNotNull();
            Condition.Requires(helper, nameof(helper)).IsNotNull();

            var wickRectangle = helper.GetPointRectangle(0.1);

            gc.FillEllipse(
                this.GetWickBruch(bomb),
                wickRectangle);
        }
Пример #7
0
        public void Draw(
            IEntity entity,
            Graphics gc)
        {
            Condition.Requires(entity, nameof(entity)).IsNotNull();
            if (entity.Type != this.EntityType)
            {
                return;
            }

            Condition.Requires(gc, nameof(gc)).IsNotNull();

            var helper = new PointDrawingHelper(this._drawSettings, entity.X, entity.Y);

            gc.FillRectangle(this._brush, helper.GetPointRectangle());
        }
Пример #8
0
        private void DrawDirection(
            Graphics gc,
            PointDrawingHelper drawingHelper,
            MirrorEntity mirror)
        {
            var rectangle = drawingHelper.GetPointRectangle();

            var point1 = mirror.Position == MirrorPosition.MainDiagonal
                ? drawingHelper.GetCornerPointLeftTop()
                : drawingHelper.GetCornerPointRightTop();

            var point2 = mirror.Position == MirrorPosition.MainDiagonal
                ? drawingHelper.GetCornerPointRightDown()
                : drawingHelper.GetCornerPointLeftDown();

            gc.DrawLine(this._brownPen, point1, point2);
            gc.DrawLine(this._bluePen, point1, point2);
        }