/** * 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; }
/** * 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; }
/** * 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 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; } }
/** * 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); }
/** * Retrieves a specific instance of the service * @param key The name of the method, returned by the service's getMethodName method. * @return The service associated with the key, or null if there is no such service. */ public @Nullable T getService(String key) { return services.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); }
public static @Nullable Quarters getQuartersForBay(Bay bay) { for (Quarters q : values()) { if (bay.getClass() == q.bayClass) { return q; } } return null; }
private static void configureLegacyLogging(@Nullable final String logFileName) { // Redirect output to logfiles, unless turned off. if (logFileName == null) { return; } MegaMek.redirectOutput(logFileName); }
public static @Nullable BayType parse(String name) { if (null != name) { for (BayType bt : values()) { if (bt.toString().toLowerCase().equals(name.toLowerCase())) { return bt; } } } return null; }
public static @Nullable System parse(String string) { if (null != string) { for (final System c : values()) { if (c.toString().equals(string.toUpperCase())) { return c; } } } return null; } }
private static void configureLog4j(@Nullable final String logFileName) { if (null == logFileName) { LogConfig.getInstance().disableAll(); return; } LogConfig.getInstance().enableSimplifiedLogging(); }
private static void configureLogging(@Nullable final String logFileName) { final String qualifiedLogFilename = PreferenceManager.getClientPreferences().getLogDirectory() + File.separator + logFileName; resetLogFile(qualifiedLogFilename); configureLegacyLogging(logFileName); configureLog4j(logFileName); }