I am trying to write networking code and I need to figure out how to structure the different types of messages. I have some bytes coming in from UDP which I want structured as my header and the message content. The header will contain the type of message it is, based on some index (like 5 for a move player packet). I want to be able to define behaviours for individual messages, and be able to treat them as generic messages (myMessage.DoStuff();). How do I get this without making a giant switch statement (or if-elseif)?