java - Static array declared but method cannot work -


I have to do my homework in this part means that I have a chess < / Code> needs to be saved and then click Reset.
Then, I have to load the chess piece back to the position before resetting.
Since I do not know the exact size of the array, I know that I do not have permission in list but homework

Nothing was shown on the screen but no Error message is not

Assume that I have a class named chess .

  Steady actor [All Chase; Public Zero Save () // It is left [actor [] allChess = GWorld.getAll object ("chess"); } Public Zero Load () / / This is loaded (if (All Chas! = Null) {for (ii) I & lt; allChess.length; i ++) {Chess ch = (Chess) All Chas [i]; GWorld.addOneObject (new chess (ch.color, ch.rank), ch.getX (), ch.getY ()); }}}  

Thanks a lot!

all chas is redeclared as local code Save () . Do this:

  Save public zeros () // Save it {allChess = GWorld.getAllObjects ("Chess"); }  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -