my problem is as follows: I want to parse a xml-file created with Tiled Map Editor where I inserted one objectlayer (for collision objects). But unfortunately, Tiled named the node in the xml-file "objectgroup" and its descendants "object"
<objectgroup name="solidObjects" width="100" height="100">
<object gid="265" x="16" y="35"/>
<object gid="265" x="66" y="36"/>
</objectgroup>
I am trying to do something like
XDocument doc = XDocument.Load("pathtoFile\sourcefile.xml");
List<Rectangle> objectList = new List<Rectangle>();
foreach (var object in doc.Element("objectgroup").Descendants("object"))
{ objectList.Add(objectRectangle); }
But since "object" is a protected word in c#, it doesn't work. Any tips how to handle this problem the easiest way?
objor something