/** * Ammo conservation biases of the unit's mounted weapons. * Defaults to an empty map. */ public Builder setAmmoConservation(@Nullable final Map<Mounted, Double> value) { ammoConservation = value; return this; }
/** * Returns the value of {@link Compute#getDamageWeaponMods(Entity, Mounted)}. * * @param attacker The attacking {@link Entity}. * @param weapon The {@link Mounted} weapon being fired. * @return The to hit modifiers as a {@link ToHitData} object. */ @StaticWrapper private ToHitData getDamageWeaponMods(final Entity attacker, final Mounted weapon) { return Compute.getDamageWeaponMods(attacker, weapon); }
/** * Sets the date a ship search was started, or null if no search is in progress. */ public void setShipSearchStart(@Nullable Calendar c) { shipSearchStart = c; }
/** * The current state of the target unit. */ public Builder setTargetState(@Nullable final EntityState value) { targetState = value; return this; }
/** * Creates and lays out a new mech display. * * @param clientgui * The ClientGUI for the GUI that is creating this UnitDisplay. * This could be null, if there is no ClientGUI, such as with * MekWars. */ public UnitDisplay(@Nullable ClientGUI clientgui) { this(clientgui, null); }
/** * Get the phase that this hidden unit will activate in (generally this * will be null, indicating that the unit isn't activating). * @return */ @Nullable public IGame.Phase getHiddenActivationPhase() { return hiddenActivationPhase; }
/** * Sets the lookup name of the available ship, or null if none were found. */ public void setShipSearchResult(@Nullable String result) { shipSearchResult = result; }
@Nullable Map<Mounted, Double> getAmmoConservation() { return ammoConservation; }
/** * Determines if the Hex is valid or not. <code>errBuff</code> can be used to return a report of why the hex is * valid. If errBuff is null, isValid shortcircuits on the first failure, otherwise it checks for all failures * and logs them. * * @param errBuff Buffer to contain error messages. If null, method returns on first failure. * @return */ public abstract boolean isValid(@Nullable StringBuffer errBuff); }
/** * Returns the UnitDisplay's ClientGUI reference, which can be null. * @return */ @Nullable public ClientGUI getClientGUI() { return clientgui; } }
/** * he current state of the shooting unit. */ public Builder setShooterState(@Nullable final EntityState value) { shooterState = value; return this; }
/** * * @param is * @param errBuff * @param continueLoadOnError */ public abstract void load(InputStream is, @Nullable StringBuffer errBuff, boolean continueLoadOnError);
@Nullable EntityState getTargetState() { return targetState; }
@Nullable EntityState getShooterState() { return shooterState; }
@Nullable public UUID getSpouseID() { return spouse; }
/** * Creates a new data set for the board, with the specified dimensions and * data; notifies listeners that a new data set has been created. * * @param width * the width dimension. * @param height * the height dimension. * @param data * new hex data appropriate for the board. * @param errBuff * A buffer for storing error messages, if any. This is allowed to be null. */ public abstract void newData(int width, int height, IHex[] data, @Nullable StringBuffer errBuff);
@Nullable protected abstract PhysicalOption calculatePhysicalTurn();
/** * Will return TRUE if it is known that a path exists to the center of the board or FALSE if it known such a path * does not exist. A NULL value will be returned in the case of not knowing one way or the other. * * @param key The {@link Key} describing the starting hex coords and movement type for a theoretical path. * @return TRUE if the path exists, FALSE if it does not or NULL if it is unknown whether or not a path exists. */ @Nullable Boolean hasPathToCenter(Key key) { return cache.get(key); }
/** * Adds a war. All named factions are considered to be at war with each other. To add a war * with multiple parties on each side, add a war record for each combination. * * @param allianceName The name of the war * @param start The war start date * @param end The war end date * @param parties All the factions involved in the war. */ protected void addWar(String warName, @Nullable Date start, @Nullable Date end, Faction... parties) { addFactionHint(wars, warName, start, end, parties); }
private static void configureLegacyLogging(@Nullable final String logFileName) { // Redirect output to logfiles, unless turned off. if (logFileName == null) { return; } MegaMek.redirectOutput(logFileName); }