internal UnFunction(UnExport export, string name, FlagValues flags, byte[] bytecode, int nativeIndex, int operatorPrecedence) : base(export, bytecode) { _name = name; _flags = flags; _nativeIndex = nativeIndex; _operatorPrecedence = operatorPrecedence; }
public object ReadInstance(string className, UnExport export) { InstanceReader reader; if (!_instanceReaders.TryGetValue(className, out reader)) { return(null); } return(ReadInstance(export, reader)); }
internal UnClass(UnExport self, int superIndex, UnPackageItem outerInstance, byte[] bytecode, FlagValues flags, UnPackageItem defaults, string config, List <string> hideCategories, List <UnPackageItem> interfaces) : base(self, superIndex, bytecode) { _outerInstance = outerInstance; _flags = flags; _defaults = defaults; _config = config; _hideCategories = hideCategories; _interfaces = interfaces; }
private string GetReturnType() { UnExport returnValue = _self.Children.SingleOrDefault(e => e.ObjectName == "ReturnValue"); if (returnValue != null) { var prop = (UnClassProperty)returnValue.ReadInstance(); return(prop == null ? "???<" + returnValue.ClassName + ">" : prop.GetPropertyType()); } return(null); }
private static void DumpOutput(UnExport export, string outDir, string text) { var outPath = Path.Combine(outDir, export.ObjectName + ".uc"); using (var fs = new FileStream(outPath, FileMode.Create)) { using (var writer = new StreamWriter(fs, Encoding.UTF8)) { writer.Write(text); } } }
public UnClassProperty(UnExport export, int arraySize, FlagValues flags, int category, short repOffset) { _export = export; _arraySize = arraySize; _flags = flags; var categoryName = export.Package.Names[category]; if (categoryName.Name != "None") { _category = categoryName; } RepOffset = repOffset; }
private static void WriteFunctionName(StreamWriter writer, UnBytecodeOwner function) { UnExport parent = function.Export.Parent; if (parent != null) { if (parent.ClassName == "State") { writer.Write(parent.Parent.ObjectName + "."); } writer.Write(parent.ObjectName + "."); } writer.WriteLine(function.Export.ObjectName); }
internal object ReadInstance(UnExport export, InstanceReader reader) { long oldPos = _stream.Position; try { _stream.Position = export.ExportOffset; return(reader.ReadInstance(this, new BinaryReader(_stream), export)); } finally { _stream.Position = oldPos; } }
public UnClassClassProperty(UnExport export, int arraySize, FlagValues flags, int category, UnPackageItem type1, UnPackageItem type2, short repOffset) : base(export, arraySize, flags, category, repOffset) { Type1 = type1; Type2 = type2; }
public UnPropertyList(UnExport export) { Export = export; }
public UnEnum(UnExport export, List<string> values) { _export = export; _values = values; }
internal void AddChild(UnExport export) { _children.Add(export); export._parent = this; }
protected UnContainer(UnExport self, int superIndex, byte[] bytecode) : base(self, bytecode) { _super = superIndex == 0 ? null : _self.Package.ResolveClassItem(superIndex); }
internal object ReadInstance(UnExport export, InstanceReader reader) { long oldPos = _stream.Position; try { _stream.Position = export.ExportOffset; return reader.ReadInstance(this, new BinaryReader(_stream), export); } finally { _stream.Position = oldPos; } }
public object ReadInstance(string className, UnExport export) { InstanceReader reader; if (!_instanceReaders.TryGetValue(className, out reader)) return null; return ReadInstance(export, reader); }
public UnState(UnExport self, byte[] bytecode) : base(self, 0, bytecode) { }
public UnConst(UnExport export, string value) { _export = export; _value = value; }
internal UnClass(UnExport self, int superIndex, UnPackageItem outerInstance, byte[] bytecode, FlagValues flags, UnPackageItem defaults, string config, List<string> hideCategories, List<UnPackageItem> interfaces) : base(self, superIndex, bytecode) { _outerInstance = outerInstance; _flags = flags; _defaults = defaults; _config = config; _hideCategories = hideCategories; _interfaces = interfaces; }
public UnScriptStruct(UnExport self, int flags, int superIndex) : base(self, superIndex, null) { _flags = flags; }
public UnTypedClassProperty(UnExport export, int arraySize, FlagValues flags, int category, UnPackageItem type, short repOffset) : base(export, arraySize, flags, category, repOffset) { Type = type; }
internal UnPropertyList ReadPropertyList(UnExport export, UnClass owner) { _stream.Position = export.ExportOffset; return PropertyListReader.ReadPropertyList(this, new BinaryReader(_stream), export, owner); }
protected UnBytecodeOwner(UnExport self, byte[] bytecode) { _self = self; _bytecode = bytecode; }
public UnClassProperty(UnExport export, int arraySize, FlagValues flags, int category, short repOffset) { _export = export; _arraySize = arraySize; _flags = flags; var categoryName = export.Package.Names[category]; if (categoryName.Name != "None") _category = categoryName; RepOffset = repOffset; }
internal UnPropertyList ReadPropertyList(UnExport export, UnClass owner) { _stream.Position = export.ExportOffset; return(PropertyListReader.ReadPropertyList(this, new BinaryReader(_stream), export, owner)); }
public UnEnum(UnExport export, List <string> values) { _export = export; _values = values; }