I am planning the classes for my game; and I am having problems to figure out the best way to connect them.
In my game I do not have the classic structure of say a FPS; where you have the player class; with stats, and AI class with enemy AI. my game is more like a sport simulation manager type; so there are various entities:
- The player; which take over a team (or play in a team)
- The NPC: other players, managers, people that work in the club.
- The team (club) itself; where either the player take control of it, so NPC will join it, or will play in it, so the team will have both player and NPCs.
- Competitions: self explanatory; team participate in it.
I was thinking to make different base classes, one for team, NPC, player and competitions, but then I need to establish relations between them.
This look more like a DB with relation between tables, compared to a standard FPS game, where everything is strictly divided and you don't get class that "belong" to some other class.
I am using Unity BTW, so far I ahve the GameManager class; which initialize the main menu, the scene manager and UI manager.
Then I have 4 different class (player, NPC, competition and team), and this is where I am stuck. Should I create references to other classes, so when I instantiate for example a team class; then I will put in it a dataset to represent the NPC classes and the player class?
Or should they not know about each other at all, and all the interaction and logic should go in the gamemanager class?