/** * Identify to the menu bar which phase is currently in progress * * @param current - the <code>int</code> value of the current phase (the * valid values for this argument are defined as constants in the * <code>Game</code> class). */ public synchronized void setPhase(IGame.Phase current) { entity = null; phase = current; // There are certain phases where we shouldn't allow the board to be // saved, however the vast majority of phases should allow it switch (current) { case PHASE_STARTING_SCENARIO: case PHASE_UNKNOWN: case PHASE_LOUNGE: case PHASE_SELECTION: case PHASE_EXCHANGE: setBoard(false); break; default: setBoard(true); break; } manageMenu(); }
public void boardNew() { RandomMapDialog rmd = new RandomMapDialog(frame, this, null, mapSettings); rmd.setVisible(true); board = BoardUtilities.generateRandom(mapSettings); game.setBoard(board); curfile = null; frame.setTitle(Messages.getString("BoardEditor.title")); //$NON-NLS-1$ menuBar.setBoard(true); bvc.doLayout(); }
new IBoard[]{board}, Arrays.asList(false), MapSettings.MEDIUM_GROUND); game.setBoard(board); menuBar.setBoard(true); } catch (IOException ex) { System.err.println("error opening file to save!"); //$NON-NLS-1$
public void boardResize() { ResizeMapDialog emd = new ResizeMapDialog(frame, this, null, mapSettings); emd.setVisible(true); board = BoardUtilities.generateRandom(mapSettings); // Implant the old board int west = emd.getExpandWest(); int north = emd.getExpandNorth(); int east = emd.getExpandEast(); int south = emd.getExpandSouth(); board = implantOldBoard(game, west, north, east, south); game.setBoard(board); curfile = null; frame.setTitle(Messages.getString("BoardEditor.title")); //$NON-NLS-1$ menuBar.setBoard(true); bvc.doLayout(); }