I checked some things about the submission process lately, and I discovered the way I played musics would just help me to fail the certification… I used to play music that way (not my actual code, it’s just an example) : SoundEffect soundEffect = content.Load<SoundEffect>(“Sounds/mySong”); SoundEffectInstance songInstance = soundEffect.CreateInstance(); songInstance.IsLooped = true; songInstance.Play(); Well, it…
Tag: Code
Type conversion
Something I didn’t know : object Convert.ChangeType(object _o, Type _t); Better than an usual cast. I needed to cast something into a type I didn’t know yet at compilation time. That’s it. Useful ! http://msdn.microsoft.com/en-us/library/dtb69x08.aspx
FieldInfo
Did you know that you could get every information on fields contained in a class ? I didn’t know I could…. I should have googled it 6 months before…. 😦 FieldInfo[] fields = this.GetType().GetFields(); foreach (FieldInfo fi in fields) { Console.WriteLine(fi.Name); } Yeah, I’m still a beginner… And I didn’t know about reflexion ! Shame…