Beispiel #1
0
 public RVmClass(string name, bool isModule)
 {
     Name             = name;
     Methods          = new VmEnvironment();
     ClassMethods     = new VmEnvironment();
     Class            = VmClassHelper.CreateClass();
     PseudoSuperClass = VmClassHelper.CreateObject();
     SuperClass       = VmClassHelper.CreateObject();
     Constants        = new Dictionary <string, Pointer>();
     IsModule         = isModule;
 }
Beispiel #2
0
        public void SetSingletonMethod(string name, VmMethod method)
        {
            if (PseudoSuperClass.Singleton)
            {
                PseudoSuperClass.ClassMethods.Set(name, method);
            }

            var cls = new RVmClass(Name + "singleton", false);

            cls.Singleton = true;
            cls.ClassMethods.Set(name, method);
            cls.SuperClass = SuperClass;
            cls.Class      = VmClassHelper.CreateClass();
            SuperClass     = cls;
        }