Exemple #1
0
        void AddClass(string name, Class cBase = null)
        {
            foreach (Class c in CurrentModule.Classes.Where(c => c.Name == name))
                Stream.Error("Class \"{0}\" already declared previously.", c.Name);

            CurrentModule.Classes.Add(new Class(name, cBase));
        }
Exemple #2
0
 public Class(string name, List<Method> methods, List<Variant> fields, Class cBase)
 {
     Module = null;
     Name = name;
     Methods = methods;
     Fields = fields;
     Base = cBase;
 }
Exemple #3
0
 public Class(Class classHandle)
 {
     Module = null;
     Name = classHandle.Name;
     Methods = classHandle.Methods;
     Fields = classHandle.Fields;
     Base = classHandle.Base;
 }
Exemple #4
0
 internal Class(string name, Class cBase)
 {
     Module = null;
     Methods = new List<Method>();
     FieldsCompiler = new Dictionary<string, Variant>();
     Fields = new List<Variant>();
     Base = cBase;
     Name = name;
 }
Exemple #5
0
        private Class ReadClass(BinaryReader stream)
        {
            List<Variant> fields;
            string name = stream.ReadString();
            string baseName = stream.ReadString();

            Class cClass = new Class(name, null);

            ushort fieldCount = stream.ReadUInt16();
            while(fieldCount-- != 0)
                cClass.Fields.Add(new Variant());

            uint methodCount = stream.ReadUInt32();
            while(methodCount-- != 0)
                cClass.Methods.Add(ReadMethod(stream));

            return cClass;
        }
Exemple #6
0
        private void WriteClass(Class cClass, BinaryWriter stream)
        {
            stream.Write(cClass.Name);
            stream.Write(cClass.Base.Name);
            stream.Write((ushort)cClass.Fields.Count);

            stream.Write(cClass.Methods.Count);
            foreach (Method method in cClass.Methods)
                WriteMethod(method, stream);
        }