コード例 #1
0
ファイル: ClassLoad64.cs プロジェクト: funk-yourself/VaultLib
        public override void WritePointerData(Vault vault, BinaryWriter bw)
        {
            _dstDefinitionsPtr = bw.BaseStream.Position;

            foreach (var field in Class.Fields.Values)
            {
                AttribDefinition64 definition = new AttribDefinition64();
                definition.Key       = VLT64Hasher.Hash(field.Name);
                definition.Type      = VLT64Hasher.Hash(field.TypeName);
                definition.Flags     = field.Flags;
                definition.Size      = field.Size;
                definition.MaxCount  = field.MaxCount;
                definition.Offset    = field.Offset;
                definition.Alignment = field.Alignment;

                definition.Write(vault, bw);
            }
        }
コード例 #2
0
        public override void WritePointerData(Vault vault, BinaryWriter bw)
        {
            _dstDefinitionsPtr = bw.BaseStream.Position;

            foreach (var field in Class.Fields.Values)
            {
                AttribDefinition64 definition = new AttribDefinition64();
                definition.Key       = VLT64Hasher.Hash(field.Name);
                definition.Alignment = field.Alignment;
                definition.Flags     = field.Flags;
                definition.MaxCount  = field.MaxCount;
                definition.Offset    = field.Offset;
                definition.Size      = field.Size;
                definition.Type      = VLT64Hasher.Hash(field.TypeName);
                definition.Write(vault, bw);
            }

            if (_srcStaticPtr != 0)
            {
                bw.AlignWriter(0x10);

                _dstStaticPtr = bw.BaseStream.Position;

                foreach (var staticField in Class.StaticFields)
                {
                    bw.AlignWriter(staticField.Alignment);
                    staticField.StaticValue.Write(vault, bw);
                }

                foreach (var staticField in Class.StaticFields)
                {
                    if (staticField.StaticValue is IPointerObject pointerObject)
                    {
                        pointerObject.WritePointerData(vault, bw);
                    }
                }
            }
        }