public virtual void SetMusic(SoundEffectInstance music) { this.music = (SoundEffectInstance)music; this.invincibleMusic = SoundFactory.GetInvincibleSong(); if (music != null) { music.Play(); } }
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(); } } }