|
Links of Interest
MainDownload Prerequisites Screenshots Articles/Code Snippets DBP Warmup Entries Blog Contact/Feedback Quick Downloads:
Diaspora
XNA Requirements Installer
External Links
Heather [layout designer]XNA |
Enum Looping
Thanks to George Clingerman I learned how to enumerate through enums in a simple way. However, his code is in VB, so I decided to post a c# version of what he has written about in case anybody doesn't know how to convert from VB.
enum Direction{Up, Down, Left, Right}
void MoveInAllDirections() { Array aDirections = System.Enum.GetValues(typeof(Direction)); foreach(Direction d in aDirections) MoveIt(d); } void MoveIt(Direction d) { //Move! Move! switch(d) { case Direction.Up: //... } } |