public LevelInfo(XElement levelInfo, ContentManager content, IControlScheme controls, GraphicsDeviceManager graphics)
{
foreach (var element in levelInfo.Elements())
{
if (element.Name == XmlKeys.LevelName)
Level = new Level(WorldSelect.LevelDirectory + element.Value + ".xml",
controls, graphics.GraphicsDevice.Viewport);
if (element.Name == XmlKeys.Timerstar)
TimerStar = Level.TimerStar = Convert.ToInt32(element.Value);
if (element.Name == XmlKeys.Collectionstar)
CollectStar = Level.CollectionStar = Convert.ToInt32(element.Value);
if (element.Name == XmlKeys.Deathstar)
DeathStar = Level.DeathStar = Convert.ToInt32(element.Value);
if (element.Name == XmlKeys.Goaltime)
_mGoalTime = Convert.ToInt32(element.Value);
if (element.Name == XmlKeys.Goalcollectable)
_mGoalCollectable = Convert.ToInt32(element.Value);
if (element.Name == XmlKeys.Unlocked)
Unlocked = element.Value == XmlKeys.True;
}
_mContent = content;
_mGraphics = graphics;
_mControls = controls;
}