using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NTERA.Engine.Runtime { public class DynamicVariable : Variable { protected EraRuntime Runtime { get; } protected Func Predicate { get; } public DynamicVariable(string name, ValueType type, EraRuntime runtime, Func predicate) : base(name, type) { Runtime = runtime; Predicate = predicate; } public override Value this[params int[] index] { get => Predicate(Runtime, index); set => throw new EraRuntimeException("Cannot assign to a dynamic variable"); } } }