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)); }
public Class(string name, List<Method> methods, List<Variant> fields, Class cBase) { Module = null; Name = name; Methods = methods; Fields = fields; Base = cBase; }
public Class(Class classHandle) { Module = null; Name = classHandle.Name; Methods = classHandle.Methods; Fields = classHandle.Fields; Base = classHandle.Base; }
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; }
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; }
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); }