C++ mutual class dependency
问题 I am writing a card game in C++. I have a player class, which handles the actions (i.e. selecting a card to lay). If the player is a human, it will use a GUI class , if it is a computer, it will use an AI class . In order for the AI class to make decisions, it needs to know some things about every player that change during the game, for example the number of cards on hand. Right now I store a player pointer for every player in a vector in the AI class. However, this leads to my problem, the