public String getDisplayName() { return "Clear Minefield: " + m_coords.getBoardNum(); }
@Override public String toString() { return "Coords (" + getX() + ", " + getY() + "); " + getBoardNum(); }
public void collapseBasement(Coords coords, IBoard board, Vector<Report> vPhaseReport) { if ((basement.get(coords) == BasementType.NONE) || (basement.get(coords) == BasementType.ONE_DEEP_NORMALINFONLY)) { System.err.println("hex has no basement to collapse"); return; } if (basementCollapsed.get(coords)) { System.err.println("hex has basement that already collapsed"); return; } Report r = new Report(2112, Report.PUBLIC); r.add(getName()); r.add(coords.getBoardNum()); vPhaseReport.add(r); System.err.println("basement " + basement + "is collapsing, hex:" + coords.toString() + " set terrain!"); board.getHex(coords).addTerrain(Terrains.getTerrainFactory().createTerrain( Terrains.BLDG_BASE_COLLAPSED, 1)); basementCollapsed.put(coords, true); }
hexBuff.append(new Coords(i % width, i / width).getBoardNum()); hexBuff.append(" "); hexBuff.append(hex.getLevel());
/** * Have the player select an Entity from the entities at the given coords. * * @param pos - the <code>Coords</code> containing targets. */ private Entity chooseEntity(Coords pos) { // Assume that we have *no* choice. Entity choice = null; // Get the available choices. List<Entity> entities = game.getEntitiesVector(pos); // Do we have a single choice? if (entities.size() == 1) { // Return that choice. choice = entities.get(0); } // If we have multiple choices, display a selection dialog. else if (entities.size() > 1) { String input = (String) JOptionPane .showInputDialog( null, Messages.getString( "BoardView1.ChooseEntityDialog.message", new Object[]{pos.getBoardNum()}), //$NON-NLS-1$ Messages.getString("BoardView1.ChooseEntityDialog.title"), //$NON-NLS-1$ JOptionPane.QUESTION_MESSAGE, null, SharedUtility .getDisplayArray(entities), null); choice = (Entity) SharedUtility.getTargetPicked(entities, input); } // End have-choices // Return the chosen unit. return choice; }
if (bldg == null) { throw new IllegalArgumentException("The coordinates, " + position.getBoardNum() + ", do not contain a building."); buff.append("Hex ").append(position.getBoardNum()).append(" of ") .append(bldg.getName()); switch (nType) {
/** * Spreads the fire, and reports the spread, to the specified hex, if * possible, if the hex isn't already on fire, and the fire roll is made. */ public void spreadFire(Coords coords, TargetRoll roll, int height) { IHex hex = game.getBoard().getHex(coords); if (hex == null) { // Don't attempt to spread fire off the board. return; } if(Math.abs(hex.ceiling() - height) > 4) { return; } if (!(hex.containsTerrain(Terrains.FIRE)) && server.checkIgnition(coords, roll)) { Report r = new Report(5150, Report.PUBLIC); r.add(coords.getBoardNum()); vPhaseReport.addElement(r); } }
Messages .getString( "TriggerBPodDialog.ChooseTargetDialog.message", new Object[] { pos.getBoardNum() }), //$NON-NLS-1$ Messages .getString("TriggerBPodDialog.ChooseTargetDialog.title"), //$NON-NLS-1$
Flare flare = flares.elementAt(i); r = new Report(5235); r.add(flare.position.getBoardNum()); r.newlines = 0; reports.addElement(r); r.add(flare.position.getBoardNum()); r.newlines = 0; reports.addElement(r);
new Object[] { ce().getShortName(), moveto.getBoardNum() }); String title = Messages .getString("DeploymentDisplay.alertDialog.title"); //$NON-NLS-1$
Messages.getString( "MovementDisplay.ChooseTargetDialog.message", new Object[]{//$NON-NLS-1$ pos.getBoardNum()}), Messages.getString("MovementDisplay.ChooseTargetDialog.title"), //$NON-NLS-1$ JOptionPane.QUESTION_MESSAGE, null, SharedUtility
r.subject = subjectId; r.player = ae.getOwnerId(); r.add(coords.getBoardNum()); vPhaseReport.addElement(r); } else { r.add(coords.getBoardNum()); vPhaseReport.addElement(r); } else {
r.subject = subjectId; r.player = ae.getOwnerId(); r.add(coords.getBoardNum()); vPhaseReport.addElement(r); } else { r.add(coords.getBoardNum()); vPhaseReport.addElement(r); } else {
if (hex.terrainLevel(Terrains.GEYSER) == 2) { r = new Report(5275, Report.PUBLIC); r.add(g.position.getBoardNum()); vPhaseReport.add(r); hex.removeTerrain(Terrains.GEYSER); if (hex.terrainLevel(Terrains.GEYSER) == 3) { r = new Report(5285, Report.PUBLIC); r.add(g.position.getBoardNum()); vPhaseReport.add(r); hex.removeAllTerrains(); r.add(g.position.getBoardNum()); vPhaseReport.add(r); hex.removeTerrain(Terrains.GEYSER);
Report r = new Report(2111, Report.PUBLIC); r.add(getName()); r.add(coords.getBoardNum()); int basementRoll = Compute.d6(2); r.add(basementRoll);
Report r = new Report(3190); r.subject = subjectId; r.add(coords.getBoardNum()); vPhaseReport.add(r); } else { Report r = new Report(3195); r.subject = subjectId; r.add(coords.getBoardNum()); vPhaseReport.add(r); } else {
/** * Check to see if screen clears */ private void resolveScreen() { IBoard board = game.getBoard(); int width = board.getWidth(); int height = board.getHeight(); // Cycle through all hexes, checking for screens debugTime("resolve screen 1", true); for (int currentXCoord = 0; currentXCoord < width; currentXCoord++ ) { for (int currentYCoord = 0; currentYCoord < height; currentYCoord++) { Coords currentCoords = new Coords(currentXCoord, currentYCoord); IHex currentHex = board.getHex(currentXCoord, currentYCoord); // check for existence of screen if (currentHex.containsTerrain(Terrains.SCREEN)){ if(Compute.d6(2)>6) { Report r = new Report(9075, Report.PUBLIC); r.add(currentCoords.getBoardNum()); vPhaseReport.addElement(r); currentHex.removeTerrain(Terrains.SCREEN); server.getHexUpdateSet().add(currentCoords); } } } } debugTime("resolve screen 1 end", true); }
break; return "Hex: " + m_coords.getBoardNum() + name;
r = new Report(3540); r.subject = subjectId; r.add(target.getPosition().getBoardNum()); r.indent(3); vPhaseReport.add(r);
Messages .getString( "SelectArtyAutoHitHexDisplay.setArtilleryTargetDialog.message", new Object[] { coords.getBoardNum() }))) { //$NON-NLS-1$ artyAutoHitHexes.addElement(coords); setArtyEnabled(startingHexes - artyAutoHitHexes.size());