Пример #1
0
        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);
        }
Пример #2
0
        public static Value Make(StructInstance structInstance)
        {
            Value result = value;

            result.Kind = Kinds.StructInstance;
            result.structInstanceValue = structInstance;
            return(result);
        }
Пример #3
0
 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;
 }
Пример #4
0
 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);
 }
Пример #5
0
 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);
 }
Пример #6
0
 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;
 }
Пример #7
0
 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;
 }