Ok - so I have a multiplayer game idea which revolves around all moves being simultaneously executed when all players are ready (i.e. “WeGo”). All players checks the “ready” button and when all have done this, all hell break loose until the turn is resolved and all players enter the planning state again.
Reading up on Yun-Kun’s excellent post I have put an enum as “currentMode” in the playerState and then I have tried to loop over all player states in both gameState and gameMode to check when all have entered the mode “kReady” to trigger a game state change but both in gameState and gameMode I get the quite cryptic “Player State Object Reference is not compatible with Player State Object Reference.”…
Ok - might be so; it is an early “blocking out” phase and I am still sketching out the particulars, but what blows my mind is that the “Player Array” which is an array of ‘Player State Object References’ available in the gameState cannot be cast to “Player State Object References” in the gameState… it is very counter-intuitive.
I try to do the exact thing I have in my original post in the gameState, but it does not grokk that.
Such a stupid error! You were right - I was thrown off by the UI “beautification” of class names… sigh.
I have named my playerState derived class player_state, and they both “beautifies” into “Player State” by the UI, so I got the cryptic error “Player State Object Reference is not compatible with Player State Object Reference”…
Well; I will now for sure change the names of my game_mode, game_state and all other similarly named derivations!