I want to make the program with the following classes: Class Player, which stores some information about players with get/set functions. Player can be as AttackPlayer, which will have own data with get/set functions. Also Player can be as ProtectorPlayer, also with some other own data with get/set functions different than in AttackPlayer.
Also Player can be TeamPlayer or FreePlayer, each of these classes have own data etc.
The question is how to implement the hierarchy correctly?
At first I thought about multiple inheritance, which is not good anyway. Something like: Player AttackPlayer extends Player ProtectorPlayer extends Player
TeamPlayer extend AttackPlayer or ProtectorPlayer FreePlayer extend AttackPlayer or ProtectorPlayer
Also I thought something about strategy pattern, but it is not applicable here, because there are no common algorithms.
Are there any approaches which helps to organize such interaction?
Another way to do it is to have a field in the Player class, which helps to identify wether the TeamPlayer/FreePlayer is Attack or Protector type, and access appropriate fields depending on that. In this case inheritance would be like this:
Player TeamPlayer extends Player FreePlayer extends Player
Attack, Protect structs or classes without inheritance, but as fields in Player class.
But I don't like such an approach and I am searching for a better design.