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 ) ) ); }
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})"; }
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})"; }
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 ) ) ); }