@Override
public MainGridWithUiSettings loadMainGrid(PlayerSetting[] playerSettings, EMapStartResources startResources) throws MapLoadException {
try (ObjectInputStream ois = new ObjectInputStream(super.getMapDataStream())) {
MatchConstants.deserialize(ois);
PlayerState[] playerStates = (PlayerState[]) ois.readObject();
GameSerializer gameSerializer = new GameSerializer();
MainGrid mainGrid = gameSerializer.load(ois);
mainGrid.initWithPlayerSettings(playerSettings);
RescheduleTimer.loadFrom(ois);
ois.close();
return new MainGridWithUiSettings(mainGrid, playerStates);
} catch (IOException | ClassNotFoundException ex) {
throw new MapLoadException(ex);
}
}