I am currently implementing a game and want to add a Network feature. (i.e. I want to be able to join and host my application/game). This seems a lot tougher than I first imagined. The purpose of this question is asking if there is a good general datastructure choice for these kind of implementations.
My main problem is that I currently have a lot of functions in my Game class that look like this:
f() { if (host) doSomething() else doSomethingCompletelyDifferent() }
You could use OOP. Alas, you do not provide which programming language you use.
For example, if you are programming in C, you could do