I have a field:
public Field[][] fields;
And I want an XML:
<Fields>
<Field x="0" y="0">
...
</Field>
<Field x="0" y="1">
...
</Field>
...
</Fields>
Unfortunately, C# XmlSerializer gives me
<Fields>
<ArrayOfField>
.... some fields here
</ArrayOfField>
<ArrayOfField>
.... some here
</ArrayOfField>
...
</Fields>
How do I achieve this?
Well, actually I don't need to stick to an array of arrays. The fields do represent a 2D space, so it was a natural choice. Would a Dictionary serialize the way I need?
Fieldclass and are mapped to the attributes. TheFieldclass serializes okay. I just cant find a way to serialize a 2d array, neither multi-dim, array of arrays nor jagged.