From 62ea3efe1680606819ae4004d068b88729dd98b4 Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Tue, 26 Aug 2025 23:24:08 -0500 Subject: [PATCH] Added Variable array --- src/Core/CsMic.Core.csproj | 2 +- src/Core/InputInterpreter.cs | 5 ++- src/Core/Variable.cs | 42 ++++++++++++++++++- .../CsMic.StandardLibrary.csproj | 2 +- 4 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/Core/CsMic.Core.csproj b/src/Core/CsMic.Core.csproj index 29d6953..67ab902 100644 --- a/src/Core/CsMic.Core.csproj +++ b/src/Core/CsMic.Core.csproj @@ -7,7 +7,7 @@ enable False CSMic.Core - 2.0.0-beta-03 + 2.0.0-beta-04 CSMic latest diff --git a/src/Core/InputInterpreter.cs b/src/Core/InputInterpreter.cs index f743ac4..a6fcdf6 100644 --- a/src/Core/InputInterpreter.cs +++ b/src/Core/InputInterpreter.cs @@ -73,7 +73,10 @@ namespace CSMic { get { - return null; + return this.numericVariables.Select(nv => new Variable(VariableType.Numeric, nv.Key, nv.Value)) + .Concat(this.expressionVariables.Select(nv => new Variable(VariableType.Expression, nv.Key, nv.Value))) + .Concat(this.numericArrayVariables.Select(nv => new Variable(VariableType.NumericArray, nv.Key, nv.Value))) + .AsEnumerable(); } } #endregion diff --git a/src/Core/Variable.cs b/src/Core/Variable.cs index 434daa1..5da61c5 100644 --- a/src/Core/Variable.cs +++ b/src/Core/Variable.cs @@ -14,7 +14,35 @@ namespace CSMic private string name; - private object value; + private object? value; + + #endregion + + #region Properties + + public VariableType Type + { + get + { + return this.type; + } + } + + public string Name + { + get + { + return this.name; + } + } + + public object? Value + { + get + { + return this.value; + } + } #endregion @@ -23,9 +51,19 @@ namespace CSMic public Variable() { this.type = VariableType.None; - this.value = string.Empty; + this.name = string.Empty; + this.value = null; } + public Variable(VariableType type, string name, object? value) + { + this.type = type; + this.name = name; + this.value = value; + } + + + #endregion } } diff --git a/src/StandardLibrary/CsMic.StandardLibrary.csproj b/src/StandardLibrary/CsMic.StandardLibrary.csproj index 68ea366..254c161 100644 --- a/src/StandardLibrary/CsMic.StandardLibrary.csproj +++ b/src/StandardLibrary/CsMic.StandardLibrary.csproj @@ -6,7 +6,7 @@ CSMic.StandardLibrary enable enable - 2.0.0-beta-03 + 2.0.0-beta-04 CSMic.StandardLibrary latest