How to access GameState variable from an Actor class?

I am new to Unreal and game dev in general and so to practice I am building a Chess game. I am trying to implement object selection so that a player can mouse-click on a chess piece and “highlight” it when selected. If a player clicks on another chess piece then the previous one gets deselected and the new one gets 'highlighted".

Currently, I am simply adjusting a dynamic material of my chess piece inside a OnSelected member function within a “ChessPiece” class. However, I am not sure how to deselect it when a new piece is selected. I have read that I should keep the game state in a GameState class, so I thought maybe I can store a ChessPiece* pointer inside a GameState class which points to the currently selected chess piece and so when a new one gets selected I can use that pointer to change it’s material back to being un-highlighted. But then I have a problem accessing my game state object from my chess piece class because my GameState class needs to include “ChessPiece.h” in order to hold a member variable of chessPiece* type, but my ChessPiece class needs to include my MyGameState.h in order to access it? So it seems to be a circular include.

It seems like a very poor design and I have no idea how to fix it. Any suggestions would help me a lot! Thanks in advance.

Solved it for now, by having a UMaterialInstanceDynamic* selected; member variable inside the GameMode class, instead of ChessPiece* variable (solves circular dependency). And so when a new mesh is selected, the ChessPiece actor will call a method within a GameMode class that “unhighlights” the currently selected material and then gets assigned a newly selected material. I think it works well for now since I don’t have to loop through every chess piece and check whether it is highlighted or not. Nonetheless, I really lack experience in game dev and don’t really know exactly what the best practices are so if you would have solved it any other way please let me know. Thanks!