Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
        public object ReadInstance(string className, UnExport export)
        {
            InstanceReader reader;

            if (!_instanceReaders.TryGetValue(className, out reader))
            {
                return(null);
            }
            return(ReadInstance(export, reader));
        }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 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);
         }
     }
 }
Esempio n. 7
0
        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;
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
        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;
            }
        }
Esempio n. 10
0
 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;
 }
Esempio n. 11
0
 public UnPropertyList(UnExport export)
 {
     Export = export;
 }
Esempio n. 12
0
 public UnEnum(UnExport export, List<string> values)
 {
     _export = export;
     _values = values;
 }
Esempio n. 13
0
 internal void AddChild(UnExport export)
 {
     _children.Add(export);
     export._parent = this;
 }
Esempio n. 14
0
 internal void AddChild(UnExport export)
 {
     _children.Add(export);
     export._parent = this;
 }
Esempio n. 15
0
 protected UnContainer(UnExport self, int superIndex, byte[] bytecode)
     : base(self, bytecode)
 {
     _super = superIndex == 0 ? null : _self.Package.ResolveClassItem(superIndex);
 }
Esempio n. 16
0
 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;
     }
 }
Esempio n. 17
0
 public object ReadInstance(string className, UnExport export)
 {
     InstanceReader reader;
     if (!_instanceReaders.TryGetValue(className, out reader))
         return null;
     return ReadInstance(export, reader);
 }
Esempio n. 18
0
 public UnState(UnExport self, byte[] bytecode)
     : base(self, 0, bytecode)
 {
 }
Esempio n. 19
0
 protected UnContainer(UnExport self, int superIndex, byte[] bytecode)
     : base(self, bytecode)
 {
     _super = superIndex == 0 ? null : _self.Package.ResolveClassItem(superIndex);
 }
Esempio n. 20
0
 public UnConst(UnExport export, string value)
 {
     _export = export;
     _value  = value;
 }
Esempio n. 21
0
 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;
 }
Esempio n. 22
0
 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;
 }
Esempio n. 23
0
 public UnScriptStruct(UnExport self, int flags, int superIndex)
     : base(self, superIndex, null)
 {
     _flags = flags;
 }
Esempio n. 24
0
 public UnTypedClassProperty(UnExport export, int arraySize, FlagValues flags, int category, UnPackageItem type, short repOffset)
     : base(export, arraySize, flags, category, repOffset)
 {
     Type = type;
 }
Esempio n. 25
0
 internal UnPropertyList ReadPropertyList(UnExport export, UnClass owner)
 {
     _stream.Position = export.ExportOffset;
     return PropertyListReader.ReadPropertyList(this, new BinaryReader(_stream), export, owner);
 }
Esempio n. 26
0
 public UnTypedClassProperty(UnExport export, int arraySize, FlagValues flags, int category, UnPackageItem type, short repOffset)
     : base(export, arraySize, flags, category, repOffset)
 {
     Type = type;
 }
Esempio n. 27
0
 protected UnBytecodeOwner(UnExport self, byte[] bytecode)
 {
     _self = self;
     _bytecode = bytecode;
 }
Esempio n. 28
0
 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;
 }
Esempio n. 29
0
 internal UnPropertyList ReadPropertyList(UnExport export, UnClass owner)
 {
     _stream.Position = export.ExportOffset;
     return(PropertyListReader.ReadPropertyList(this, new BinaryReader(_stream), export, owner));
 }
Esempio n. 30
0
 protected UnBytecodeOwner(UnExport self, byte[] bytecode)
 {
     _self     = self;
     _bytecode = bytecode;
 }
Esempio n. 31
0
 public UnEnum(UnExport export, List <string> values)
 {
     _export = export;
     _values = values;
 }
Esempio n. 32
0
 public UnScriptStruct(UnExport self, int flags, int superIndex)
     : base(self, superIndex, null)
 {
     _flags = flags;
 }
Esempio n. 33
0
 public UnState(UnExport self, byte[] bytecode)
     : base(self, 0, bytecode)
 {
 }