public void ReadXmlConf() { try { XmlDocument doc = new XmlDocument(); doc.Load(bombermanGConfigXml); for (int i = 0; i < 6; i++) { levels[i] = new Level(); } GetListBombermanGConfiguration(doc); } catch (Exception e) { } }
private Level ReadDataConfiguration(XmlNode levelNode) { Level level = new Level(); if (levelNode != null) { XmlNodeList levelData = levelNode.ChildNodes; XmlElement width = (XmlElement)levelData.Item(0); //GlobalVariables.WIDTH = int.Parse(width.GetAttribute("width")); //level.bombermanPosX = int.Parse(width.GetAttribute("posX")); } return level; }
private Level LoadLevel(XmlNode levelNode) { Level level = new Level(); if (levelNode != null) { XmlNodeList levelData = levelNode.ChildNodes; level.blocks = LoadBlocks(levelData.Item(0)); level.powerUps = LoadPowerUps(levelData.Item(1)); level.enemies = LoadEnemies(levelData.Item(2)); } return level; }