public static string[] ListStructInstanceKeys(StructInstance str) { var count = str.Struct.Fields.Length; var result = new string[count]; Array.Copy(str.Struct.Fields, result, count); return(result); }
public static Value Make(StructInstance structInstance) { Value result = value; result.Kind = Kinds.StructInstance; result.structInstanceValue = structInstance; return(result); }
public static Value GetStructInstanceValue(StructInstance str, string key, Value defaultValue) { for (int i = 0; i < str.Struct.Fields.Length; i++) { if (str.Struct.Fields[i] == key) { return str.Values[i]; } } return defaultValue; }
public static Value GetStructInstanceValue(StructInstance str, string key, Value defaultValue) { for (int i = 0; i < str.Struct.Fields.Length; i++) { if (str.Struct.Fields[i] == key) { return(str.Values[i]); } } return(defaultValue); }
public static bool SetStructInstanceValue(StructInstance str, string key, Value newValue) { for (int i = 0; i < str.Struct.Fields.Length; i++) { if (str.Struct.Fields[i] == key) { str.Values[i] = newValue; return(true); } } return(false); }
public static string[] ListStructInstanceKeys(StructInstance str) { var count = str.Struct.Fields.Length; var result = new string[count]; Array.Copy(str.Struct.Fields, result, count); return result; }
public static bool SetStructInstanceValue(StructInstance str, string key, Value newValue) { for (int i = 0; i < str.Struct.Fields.Length; i++) { if (str.Struct.Fields[i] == key) { str.Values[i] = newValue; return true; } } return false; }