Use the enum like an enum

Enums are first-class objects, meant to replace these ugly if
statements. Use them like that!
Replace tabs with spaces

Replace the tabs with spaces
Make it perfectly the same
Merge pull request #1 from Tjstretchalot/master

Use the default enum methods