예제 #1
0
파일: Api.cs 프로젝트: fsoikin/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);
        }
예제 #2
0
        public static Value Make(StructInstance structInstance)
        {
            Value result = value;

            result.Kind = Kinds.StructInstance;
            result.structInstanceValue = structInstance;
            return(result);
        }
예제 #3
0
파일: Api.cs 프로젝트: 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;
 }
예제 #4
0
파일: Api.cs 프로젝트: richardy2012/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);
 }
예제 #5
0
파일: Api.cs 프로젝트: richardy2012/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);
 }
예제 #6
0
파일: Api.cs 프로젝트: 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;
 }
예제 #7
0
파일: Api.cs 프로젝트: 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;
 }