How do game programmers design their classes to reuse in AI, network and play and pass mode?
- by Amogh Talpallikar
For a two player game where, your opponent could be on the network, CPU itself or near you where you would play turn by turn on the same machine.
How do people design classes for re-use ?
I am in a similar situation and have no experience in making such complex games.
But here is what I have thought,
If I am a player object , I should only be interacting with the GameManager or GameEngine Singleton , from which I will get various notifications about the game status.
I dont care where and who my opponent is, this GameManager depending upon the game mode, will interact with gameNetworkManager , or AI tell me what the opponent played.
I am not sure about the scenario where we play and pass [turn by turn on same machine].
Hoping for a brief but clear explanation or at least a link to a similar resource.:)