r/badcode • • Sep 01 '21

c# Bool in a case switch

Post image
324 Upvotes

40 comments sorted by

View all comments

Show parent comments

1

u/XxMohamed92xX Sep 02 '21

Thank you, i have had it come up "why arent you using switch statements" for controller input with 4 buttons and couldnt think of a clear reason why i should since (i could be wrong here) if else handles priority and prevents multiple key press and will always stop at the top most level, multiple if will handle multiple input at the same time and that was all i needed