Zdravim,
potreboval bych poradit jak nacitat data z XML do list<Level>, asi nejlepe za pomoci LINQ ale nejak se mi to nedari spravne rozhodit.
XML vypada takto
<Levels>
<Level levelNumber = "1" startingX="2" startingY="2">
<Cells>
<Cell CellType="A" PositionX="0" PositionY="0" />
<Cell CellType="A" PositionX="1" PositionY="0" />
<Cell CellType="A" PositionX="2" PositionY="0" />
...
</Cells>
</Level>
</Levels>
trida Level
public class Level
{
private int levelNumber;
private int startingX;
private int startingY;
public List<Cell> cellList = new List<Cell>();
[XmlAttribute("levelNumber")]
public int LevelNumber
{
get { return this.levelNumber; }
set { this.levelNumber = value; }
}
....
}
V tride cell mam anotaci hlavicek samozrejme taky..
Diky za rady