Esempio n. 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);
        }
Esempio n. 2
0
        public static Value Make(StructInstance structInstance)
        {
            Value result = value;

            result.Kind = Kinds.StructInstance;
            result.structInstanceValue = structInstance;
            return(result);
        }
Esempio n. 3
0
File: Api.cs Progetto: mbrezu/Shovel
 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;
 }
Esempio n. 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);
 }
Esempio n. 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);
 }
Esempio n. 6
0
File: Api.cs Progetto: mbrezu/Shovel
 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;
 }
Esempio n. 7
0
File: Api.cs Progetto: mbrezu/Shovel
 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;
 }