public UpdatableGameState update ( GameUpdateApiResponse gameUpdateData ) { return new UpdatableGameState ( gameUpdateData . getTurn ( ) , startData , MapPatcher . patch ( gameUpdateData . getMapDiff ( ) , rawMapArray ) , MapPatcher . patch ( gameUpdateData . getCitiesDiff ( ) , rawCitiesArray ) , gameUpdateData . getGenerals ( ) , createPlayersInfo ( startData , gameUpdateData ) , gameUpdateData . getAttackIndex ( ) ) ; }
Updates game state from previous turn with new information received from server . The method only works fine if updates are applied in sequence as server is only sending map differences in update messages .