Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Ignore formats removes next node #120

Open
janovrom opened this issue Apr 17, 2020 · 0 comments
Open

Ignore formats removes next node #120

janovrom opened this issue Apr 17, 2020 · 0 comments

Comments

@janovrom
Copy link

Imagine this code:

public class BufferView
    {
        [ZeroFormatter.IgnoreFormat] public int Width { get => TriangleCount; set => TriangleCount = value; }
        [ZeroFormatter.IgnoreFormat] public int Height { get => VertexCount; set => VertexCount = value; }
        [ZeroFormatter.Index(0)] public virtual byte Padding { get; set; } // IgnoreFormat for some reason removes the first index
        [ZeroFormatter.Index(1)] public virtual long Start { get; set; }
        [ZeroFormatter.Index(2)] public virtual long ByteLength { get; set; }
        [ZeroFormatter.Index(3)] public virtual int TriangleCount { get; set; }
        [ZeroFormatter.Index(4)] public virtual int VertexCount { get; set; }
    }

This will result in Padding not being serialized - when searching for this property in the ZFC-generated file, it's no there. If the properties with IgnoreFormatAttribute are moved to the end, even the whole next ZeroFormattable class is removed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant