Class BehaviorSettingsFactory

java.lang.Object
megamek.client.bot.princess.BehaviorSettingsFactory

public class BehaviorSettingsFactory extends Object
Since:
9/6/13 6:50 PM
  • Field Details

    • BERSERK_BEHAVIOR

      public final BehaviorSettings BERSERK_BEHAVIOR
      Destination Edge: CardinalEdge.NONE
      Retreat Edge: CardinalEdge.NONE
      Forced Withdrawal: False
      Go Home: False
      Auto Flee: False
      Fall Shame: 2
      Hyper Aggression: 10
      Self Preservation: 2
      Mutual Support: 5
      Bravery: 9
      Anti-Crowding: 0
      Favor Higher TMM: 0
      Strategic Targets: None
    • BERSERK_BEHAVIOR_DESCRIPTION

      public static final String BERSERK_BEHAVIOR_DESCRIPTION
      See Also:
    • COWARDLY_BEHAVIOR

      public final BehaviorSettings COWARDLY_BEHAVIOR
      Destination Edge: CardinalEdge.NONE
      Retreat Edge: CardinalEdge.NEAREST
      Forced Withdrawal: True
      Go Home: False
      Auto Flee: False
      Fall Shame: 8
      Hyper Aggression: 1
      Self Preservation: 10
      Mutual Support: 8
      Bravery: 2
      Anti-Crowding: 0
      Favor Higher TMM: 0
      Strategic Targets: None
    • COWARDLY_BEHAVIOR_DESCRIPTION

      public static final String COWARDLY_BEHAVIOR_DESCRIPTION
      See Also:
    • ESCAPE_BEHAVIOR

      public final BehaviorSettings ESCAPE_BEHAVIOR
      Destination Edge: CardinalEdge.NONE
      Retreat Edge: CardinalEdge.NEAREST
      Forced Withdrawal: True
      Go Home: True
      Auto Flee: True
      Fall Shame: 7
      Hyper Aggression: 3
      Self Preservation: 10
      Mutual Support: 5
      Bravery: 2
      Anti-Crowding: 0
      Favor Higher TMM: 0
      Strategic Targets: None
    • ESCAPE_BEHAVIOR_DESCRIPTION

      public static final String ESCAPE_BEHAVIOR_DESCRIPTION
      See Also:
    • RUTHLESS_BEHAVIOR

      public final BehaviorSettings RUTHLESS_BEHAVIOR
      Destination Edge: CardinalEdge.NONE
      Retreat Edge: CardinalEdge.NEAREST
      Forced Withdrawal: True
      Go Home: True
      Auto Flee: True
      Fall Shame: 7
      Hyper Aggression: 3
      Self Preservation: 10
      Mutual Support: 5
      Bravery: 2
      Anti-Crowding: 0
      Favor Higher TMM: 0
      Strategic Targets: None
    • RUTHLESS_BEHAVIOR_DESCRIPTION

      public static final String RUTHLESS_BEHAVIOR_DESCRIPTION
      See Also:
    • PIRATE_BEHAVIOR

      public final BehaviorSettings PIRATE_BEHAVIOR
      Destination Edge: CardinalEdge.NONE
      Retreat Edge: CardinalEdge.NEAREST
      Forced Withdrawal: True
      Go Home: True
      Auto Flee: True
      Fall Shame: 7
      Hyper Aggression: 3
      Self Preservation: 10
      Mutual Support: 5
      Bravery: 2
      Anti-Crowding: 0
      Favor Higher TMM: 0
      Strategic Targets: None
    • PIRATE_BEHAVIOR_DESCRIPTION

      public static final String PIRATE_BEHAVIOR_DESCRIPTION
      See Also:
    • CONVOY_BEHAVIOR

      public final BehaviorSettings CONVOY_BEHAVIOR
      Destination Edge: CardinalEdge.NONE
      Retreat Edge: CardinalEdge.NEAREST
      Forced Withdrawal: True
      Go Home: True
      Auto Flee: True
      Fall Shame: 6
      Hyper Aggression: 3
      Self Preservation: 10
      Mutual Support: 5
      Bravery: 2
      Anti-Crowding: 5
      Favor Higher TMM: 10
      Ignore Damage Output: True
      Strategic Targets: None
    • CONVOY_BEHAVIOR_DESCRIPTION

      public static final String CONVOY_BEHAVIOR_DESCRIPTION
      See Also:
    • DEFAULT_BEHAVIOR

      public final BehaviorSettings DEFAULT_BEHAVIOR
      Destination Edge: CardinalEdge.NONE
      Retreat Edge: CardinalEdge.NEAREST
      Forced Withdrawal: True
      Go Home: False
      Auto Flee: False
      Fall Shame: 5
      Hyper Aggression: 5
      Self Preservation: 5
      Mutual Support: 5
      Bravery: 5
      Anti-Crowding: 0
      Favor Higher TMM: 0
      Strategic Targets: None
    • DEFAULT_BEHAVIOR_DESCRIPTION

      public static final String DEFAULT_BEHAVIOR_DESCRIPTION
      See Also:
  • Method Details

    • getInstance

      public static BehaviorSettingsFactory getInstance()
    • init

      public void init(boolean reinitialize)
      Initializes the BehaviorSettings cache. If the cache is empty, it will load from mmconf/princessBehaviors.xml. Also, if the "DEFAULT" behavior is missing, it will be added.
      Parameters:
      reinitialize - Set TRUE to force the cache to be completely rebuilt.
    • addBehavior

      public void addBehavior(BehaviorSettings behaviorSettings)
      Adds a BehaviorSettings to the cache. If a behavior with the same name is already in the cache, it will be overwritten.
      Parameters:
      behaviorSettings - The BehaviorSettings to be added to the cache.
    • removeBehavior

      public void removeBehavior(String settingName)
      Removes the behavior setting with the given name from the cache. Returns the BehaviorSettings that was removed (or null if there was no such BehaviorSettings).
    • getBehavior

      public BehaviorSettings getBehavior(String desc)
      Returns the named BehaviorSettings.
      Parameters:
      desc - The name of the behavior; matched to BehaviorSettings.getDescription().
      Returns:
      The named behavior or NULL if no match is found.
    • getBehaviorOrDefault

      public BehaviorSettings getBehaviorOrDefault(String desc, BehaviorSettings defaultBehavior)
      Returns the named BehaviorSettings.
      Parameters:
      desc - The name of the behavior; matched to BehaviorSettings.getDescription().
      Returns:
      The named behavior or default if no match is found.
    • saveBehaviorSettings

      public void saveBehaviorSettings(boolean includeTargets)
      Saves the contents of the cache to the mmconf/princessBehaviors.xml file.
      Parameters:
      includeTargets - Set TRUE to include the contents of the Strategic Targets list.
    • getBehaviorNames

      public String[] getBehaviorNames()
      Returns:
      an array of the names of all the BehaviorSettings in the cache.
    • getBehaviorNameList

      public List<String> getBehaviorNameList()
      Returns a list of the names of all the available BehaviorSettings.