Fix enumerator issue with numerically keyed script tables

This commit is contained in:
Deukhoofd 2018-12-09 18:42:41 +01:00
parent ff9eac888f
commit 0843c9b624
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 10 additions and 6 deletions

View File

@ -19,10 +19,6 @@ namespace Upsilon.BaseTypes.ScriptTable
} }
} }
IEnumerator<ScriptType> IEnumerable<ScriptType>.GetEnumerator()
{
return GetScriptEnumerator();
}
public override System.Type GetCSharpType() public override System.Type GetCSharpType()
{ {
@ -34,9 +30,17 @@ namespace Upsilon.BaseTypes.ScriptTable
return EvaluationScope.Variables.Select(x => x.Value.ToCSharpObject()).ToArray(); return EvaluationScope.Variables.Select(x => x.Value.ToCSharpObject()).ToArray();
} }
public IEnumerator GetEnumerator() public IEnumerator<ScriptType> GetEnumerator()
{ {
return GetScriptEnumerator(); foreach (var variable in EvaluationScope.Variables)
{
yield return variable.Value;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
} }
} }
} }