I?ve got a question about copying objects as if they were variables.
I?m making a turn based card game with 4 players (hotseat game). Each player is represented as an Object with a number of attributes (CardsInHand, Score etc.).
When Events happen in the game I need to update one of the players attributes depending on whose turn it is. So something like this
CurrentPlayer = Player1
<then play the turn>
Add 1 to CurrentPlayer score
Add a card to the CurrentPlayer hand
CurrentPlayer = Player2
What?s the best way to accomplish this while keeping the code as simple as possible?