Exemplo n.º 1
0
        public void Interpret(Context context)
        {
            int width  = context.Rectangle.Width;
            int height = context.Rectangle.Height;
            int margin = 50;

            int childWidth  = width / 2 - margin;
            int childHeight = height - margin;

            _left.Interpret(
                new Context(
                    context.Graphics,
                    new Rectangle(
                        context.Rectangle.X + margin / 2,
                        context.Rectangle.Y + margin / 2,
                        childWidth,
                        childHeight
                        )
                    )
                );

            _right.Interpret(
                new Context(
                    context.Graphics,
                    new Rectangle(
                        context.Rectangle.X + (width + margin) / 2,
                        context.Rectangle.Y + margin / 2,
                        childWidth,
                        childHeight
                        )
                    )
                );
        }
Exemplo n.º 2
0
        public void Interpret(Context context)
        {
            Context innerContext = new Context();

            _inner.Interpret(innerContext);

            Context outerContext = new Context();

            _outer.Interpret(outerContext);

            context.Evaluation = $"({innerContext.Evaluation} inside {outerContext.Evaluation})";
        }
Exemplo n.º 3
0
        public void Interpret(Context context)
        {
            Context leftContext = new Context();

            _left.Interpret(leftContext);

            Context rightContext = new Context();

            _right.Interpret(rightContext);

            context.Evaluation = $"({leftContext.Evaluation} next to {rightContext.Evaluation})";
        }
Exemplo n.º 4
0
        public void Interpret(Context context)
        {
            int width  = context.Rectangle.Width;
            int height = context.Rectangle.Height;

            _outer.Interpret(context);

            int widthMargin  = width / 5;
            int heightMargin = height / 5;

            _inner.Interpret(
                new Context(
                    context.Graphics,
                    new Rectangle(
                        context.Rectangle.X + widthMargin,
                        context.Rectangle.Y + heightMargin,
                        width - 2 * widthMargin,
                        height - 2 * heightMargin
                        )
                    )
                );
        }