I have this chunk of code:
Then my java compiler says:Code:GameState [] tempGS = new GameState[7]; // for each of the moves a clean gamestate. for ( int x=1; x<=6; x++) tempGS[x] = state.clone();
Incompatible type for =. Can't convert Object to GameState.
Now I can read, obviously you can't convert GameState object to a GameState.clone() with the equals operator. So what did I do wrong? did I declare tempGS wrong, is there another way to get a copy of state (a GameState) into my array of GameStates?
Thanks!
NOMAD
ps: Yes, GameState is cloneable and no I did not write it (nor can I see it (only have class))




Reply With Quote