private static String formatHeader(Entity e) { StringBuffer sb = new StringBuffer(1024); sb.append("Model: ").append(e.getChassis()).append(" - ") .append(e.getModel()).append(CommonConstants.NL); for (int i = 0; i < e.getCrew().getSlotCount(); i++) { if (e.getCrew().isMissing(i)) { sb.append("No ").append(e.getCrew().getCrewType().getRoleName(i)); } else { sb.append(e.getCrew().getCrewType().getRoleName(i)).append(": ") .append(e.getCrew().getName(i)); sb.append(" (").append(e.getCrew().getGunnery(i)).append("/") .append(e.getCrew().getPiloting(i)).append(")"); } sb.append(CommonConstants.NL); } if (e.isCaptured()) { sb.append(" *** CAPTURED BY THE ENEMY ***"); sb.append(CommonConstants.NL); } return sb.toString(); }
/** * Returns the number of non-destroyed entities owned by the player, * including entities not yet deployed. Ignore offboard units and captured * Mek pilots. */ public int getLiveDeployedEntitiesOwnedBy(IPlayer player) { int count = 0; for (Entity entity : entities) { if (entity.getOwner().equals(player) && !entity.isDestroyed() && !entity.isCarcass() && !entity.isOffBoard() && !entity.isCaptured()) { count++; } } return count; }
/** * Returns the number of non-destroyed deployed entities owned by the * player. Ignore offboard units and captured Mek pilots. */ public int getLiveCommandersOwnedBy(IPlayer player) { int count = 0; for (Entity entity : entities) { if (entity.getOwner().equals(player) && !entity.isDestroyed() && !entity.isCarcass() && entity.isCommander() && !entity.isOffBoard() && !entity.isCaptured()) { count++; } } return count; }
&& !entity.isOffBoard() && entity.getCrew().isActive() && !entity.isCaptured() && !(entity instanceof MechWarrior)) { int bonus = 0;