public void Parse(IEnumerable <XElement> elements) { foreach (XElement element in elements) { String b, m; b = (string)element.Attribute(GenericParser.backgroundAttr); m = (string)element.Attribute(GenericParser.musicAttr); if (b.Equals(GenericParser.desert)) { Background = SpriteFactory.GetDesertBackgroundSprite(); } else if (b.Equals(GenericParser.hospital)) { Background = SpriteFactory.GetHospitalBackgroundSprite(); } else { Background = SpriteFactory.GetDSBackgroundSprite(); } if (m.Equals(GenericParser.desert)) { Music = SoundFactory.GetDesertSong(); } else if (m.Equals(GenericParser.hospital)) { Music = SoundFactory.GetHospitalSong(); } else { Music = SoundFactory.GetInvincibleSong(); } } }
public static void ParseProperties(IEnumerable <XElement> elements) { foreach (XElement element in elements) { String b, m; b = (string)element.Attribute(backgroundAttr); m = (string)element.Attribute(musicAttr); if (b.Equals(desert)) { background = SpriteFactory.GetDesertBackgroundSprite(); } else if (b.Equals(hospital)) { background = SpriteFactory.GetDesertBackgroundSprite(); } else { //background = SpriteFactory.GetDesertBackgroundSprite(); } if (m.Equals(desert)) { music = SoundFactory.GetDesertSong(); } else if (m.Equals(hospital)) { music = SoundFactory.GetHospitalSong(); } else { //music = SoundFactory.GetDesertSongSound(); } } }