How do game programmers design their classes to reuse in AI, network and play and pass mode?

Posted by Amogh Talpallikar on Programmers See other posts from Programmers or by Amogh Talpallikar
Published on 2012-07-10T05:36:42Z Indexed on 2012/07/10 9:21 UTC
Read the original article Hit count: 366

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.:)

© Programmers or respective owner

Related posts about design-patterns

Related posts about object-oriented