public DataForgeEnumDefinition(DataForge documentRoot)
     : base(documentRoot)
 {
     this.NameOffset      = this._br.ReadUInt32();
     this.ValueCount      = this._br.ReadUInt16();
     this.FirstValueIndex = this._br.ReadUInt16();
 }
 public DataForgeDataMapping(DataForge documentRoot)
     : base(documentRoot)
 {
     this.StructCount = this._br.ReadUInt16();
     this.StructIndex = this._br.ReadUInt16();
     this.NameOffset  = documentRoot.StructDefinitionTable[this.StructIndex].NameOffset;
 }
Beispiel #3
0
 public DataForgeStructDefinition(DataForge documentRoot)
     : base(documentRoot)
 {
     this.NameOffset          = this._br.ReadUInt32();
     this.ParentTypeIndex     = this._br.ReadUInt32();
     this.AttributeCount      = this._br.ReadUInt16();
     this.FirstAttributeIndex = this._br.ReadUInt16();
     this.NodeType            = this._br.ReadUInt32();
 }
Beispiel #4
0
 public DataForgePropertyDefinition(DataForge documentRoot)
     : base(documentRoot)
 {
     this.NameOffset     = this._br.ReadUInt32();
     this.StructIndex    = this._br.ReadUInt16();
     this.DataType       = (EDataType)this._br.ReadUInt16();
     this.ConversionType = (EConversionType)this._br.ReadUInt16();
     this.Padding        = this._br.ReadUInt16();
 }
Beispiel #5
0
 public DataForgeDataMapping(DataForge documentRoot)
     : base(documentRoot)
 {
     if (this.DocumentRoot.FileVersion >= 5)
     {
         this.StructCount = this._br.ReadUInt32();
         this.StructIndex = this._br.ReadUInt32();
     }
     else
     {
         this.StructCount = this._br.ReadUInt16();
         this.StructIndex = this._br.ReadUInt16();
     }
     this.NameOffset = documentRoot.StructDefinitionTable[this.StructIndex].NameOffset;
 }
Beispiel #6
0
        public void Smelt(String path, Boolean overwrite = true)
        {
            this._overwrite = overwrite;

            try
            {
                if (File.Exists(path))
                {
                    if (Path.GetExtension(path) == ".dcb")
                    {
                        using (BinaryReader br = new BinaryReader(File.OpenRead(path)))
                        {
                            var legacy = new FileInfo(path).Length < 0x0e2e00;

                            var df = new DataForge(br, legacy);

                            df.Save(Path.ChangeExtension(path, "xml"));
                        }
                    }
                    else
                    {
                        if (!_overwrite)
                        {
                            if (!File.Exists(Path.ChangeExtension(path, "raw")))
                            {
                                File.Move(path, Path.ChangeExtension(path, "raw"));
                                path = Path.ChangeExtension(path, "raw");
                            }
                        }

                        var xml = CryXmlSerializer.ReadFile(path);

                        if (xml != null)
                        {
                            xml.Save(Path.ChangeExtension(path, "xml"));
                        }
                        else
                        {
                            Console.WriteLine("{0} already in XML format", path);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error converting {0}: {1}", path, ex.Message);
            }
        }
Beispiel #7
0
        public DataForgeRecord(DataForge documentRoot)
            : base(documentRoot)
        {
            this.NameOffset = this._br.ReadUInt32();

            if (!this.DocumentRoot.IsLegacy)
            {
                this.FileNameOffset = this._br.ReadUInt32();
            }

            this.StructIndex = this._br.ReadUInt32();
            this.Hash        = this._br.ReadGuid(false);

            this.VariantIndex = this._br.ReadUInt16();
            this.OtherIndex   = this._br.ReadUInt16();
        }
 public DataForgeStringLookup(DataForge documentRoot)
     : base(documentRoot)
 {
     this._value = this._br.ReadUInt32();
 }
 public _DataForgeSerializable(DataForge documentRoot)
 {
     this.DocumentRoot = documentRoot;
     this._br          = documentRoot._br;
 }
Beispiel #10
0
 public DataForgeGuid(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Value = this._br.ReadGuid(false).Value;
 }
Beispiel #11
0
 public DataForgeDouble(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Value = this._br.ReadDouble();
 }
Beispiel #12
0
 public DataForgeInt8(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Value = this._br.ReadSByte();
 }
Beispiel #13
0
 public DataForgeUInt64(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Value = this._br.ReadUInt64();
 }
Beispiel #14
0
 public DataForgeEnum(DataForge documentRoot)
     : base(documentRoot)
 {
     this._value = this._br.ReadUInt32();
 }
Beispiel #15
0
 public DataForgeString(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Value = this._br.ReadCString();
 }
Beispiel #16
0
 public DataForgeInt32(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Value = this._br.ReadInt32();
 }
Beispiel #17
0
 public DataForgeBoolean(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Value = this._br.ReadBoolean();
 }
Beispiel #18
0
 public DataForgeReference(DataForge documentRoot)
     : base(documentRoot)
 {
     this.Item1 = this._br.ReadUInt32();
     this.Value = this._br.ReadGuid(false).Value;
 }
Beispiel #19
0
 public DataForgePointer(DataForge documentRoot)
     : base(documentRoot)
 {
     this.StructType = this._br.ReadUInt32();
     this.Index      = this._br.ReadUInt32();
 }