@Override public String getMapId() { return mapContent.getChecksum() + getMapName(); }
@Override public MapFileHeader getFileHeader() { if (isMapOK) { return new MapFileHeader( MapFileHeader.MapType.NORMAL, getMapName(), getMapId(), getDescription(), (short) mapContent.widthHeight, (short) mapContent.widthHeight, (short) getMinPlayers(), (short) getMaxPlayers(), getCreationDate(), getImage()); } return null; }
@Override public MainGridWithUiSettings loadMainGrid(PlayerSetting[] playerSettings, EMapStartResources startResources) throws MapLoadException { MilliStopWatch watch = new MilliStopWatch(); loadMapContent(startResources, playerSettings); OriginalMapFileContent mapData = mapContent.mapData; mapData.calculateBlockedPartitions(); watch.stop("Loading original map data required"); byte numberOfPlayers = (byte) getMaxPlayers(); if (playerSettings == null || CommonConstants.ACTIVATE_ALL_PLAYERS) { playerSettings = new PlayerSetting[numberOfPlayers]; for (int i = 0; i < numberOfPlayers; i++) { playerSettings[i] = new PlayerSetting((byte) i); } } MainGrid mainGrid = new MainGrid(getMapId(), getMapName(), mapData, playerSettings); PlayerState[] playerStates = new PlayerState[numberOfPlayers]; for (byte playerId = 0; playerId < numberOfPlayers; playerId++) { playerStates[playerId] = new PlayerState(playerId, new UIState(mapData.getStartPoint(playerId))); } return new MainGridWithUiSettings(mainGrid, playerStates); }