/// <summary> /// Initialize a new instance of the <see cref="InteractiveContext"/> class using the specified parameters. /// </summary> /// <param name="memory">The variable memory used by the context.</param> /// <param name="memoryCreator">The variable memory creator used by the context.</param> /// <param name="objectCreator">The object creator used by the context.</param> /// <param name="operators">The calculater containing the operators used by the context.</param> /// <param name="console">The console used by the context.</param> /// <exception cref="ArgumentNullException">The parameter is <see langword="null"/>.</exception> public InteractiveContext( IVariableMemory memory, IMemoryCreator memoryCreator, IObjectCreator objectCreator, IOperatorCalculator operators, IConsole console) : base(memory, memoryCreator, objectCreator, operators) { Console = console; }
/// <summary> /// Initialize a new instance of the <see cref="RuntimeContext"/> class using the specified parameters. /// </summary> /// <param name="memoryCreator">The variable memory creator used by the context.</param> /// <param name="objectCreator">The object creator used by the context.</param> /// <param name="operators">The calculater containing the operators used by the context.</param> /// <exception cref="ArgumentNullException">The parameter is <see langword="null"/>.</exception> public RuntimeContext( IMemoryCreator memoryCreator, IObjectCreator objectCreator, IOperatorCalculator operators) { if (memoryCreator == null || objectCreator == null || operators == null) { throw new ArgumentNullException(); } MemoryCreator = memoryCreator; Memory = memoryCreator.Create(); ObjectCreator = objectCreator; Operators = operators; }