From: Stefan F. <ste...@we...> - 2013-09-23 09:04:00
|
I agree with Erik, that there should not be an issue with save files, unless you break the mechanism of tileLays for the other games. TileLaysPerColour is never stored inside the save file. The best approach in Rails 1.x is to use the following method in GameManager: public void initialiseNewPhase(PhaseI phase); This allows to change tileLaysPerColour according to the new change. However do not forget to change tileLaysPerColour to a stateful variable, thus from a Map to a HashMapState in the Phase class, otherwise undo will not work correctly. Most likely method initFromMap(...) in HashMapState will be helpful. In Rails 2.0 there will be a new PhaseChangeInterface will be available to allow easier access to Phase changes, however it is not implemented so far. For 1853 I would wait to implement the requirements until we start coding for that game, as it seems that the tile lays conditions are quite specific to each game. But I might be wrong here. Stefan On 09/22/2013 08:42 PM, Erik Vos wrote: > Hello Martin, > >> I think we need a localised copy of tileLaysPerColur for each Phase, but > of >> course can copy the contents of the previousPhase if no change is >> detected... > > That would be the normal fix indeed. > >> But we will break every savegame if we fix that rails.game.phase.java. > > Why exactly? Only the player moves are saved, and I don't immediately see > why saved games would be broken, as long as no incorrect moves have been > played that would be rejected after the fix. > > Erik > > > |