Esempio n. 1
0
    public static int bar(AbsClass obj)
    {
        var v = (obj as SubClass);

        Contract.Assert(v != null);
        return(v.y + v.z);
    }
Esempio n. 2
0
    public static int foo(AbsClass obj)
    {
        var v = (obj as TestClass);

        Contract.Assert(v != null);
        return(v.y + v.x);
    }
Esempio n. 3
0
        public void WriteConsole(AbsClass inter, AbsClass inter2)
        {
            if (inter == null)
            {
                return;
            }

            if (inter2 == null)
            {
                return;
            }

            if (inter is Class3)
            {
                Console.Write("");
            }
            if (inter is Class4)
            {
                Console.Write("");
            }

            if (inter is Class1)
            {
                Console.Write("");
            }

            if (inter is Class7)
            {
                Console.Write("");
            }
        }
Esempio n. 4
0
 static public int get_x(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         AbsClass self = (AbsClass)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.x);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Esempio n. 5
0
 static public int get_x(IntPtr l)
 {
     try {
         AbsClass self = (AbsClass)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.x);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 6
0
 static public int set_x(IntPtr l)
 {
     try {
         AbsClass     self = (AbsClass)checkSelf(l);
         System.Int32 v;
         checkType(l, 2, out v);
         self.x = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }