示例#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;
 }
示例#2
0
文件: UnFunction.cs 项目: yole/unhood
 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;
 }
示例#3
0
文件: UnPackage.cs 项目: yole/unhood
        public object ReadInstance(string className, UnExport export)
        {
            InstanceReader reader;

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