Codota Logo
megamek.client.bot.princess
Code IndexAdd Codota to your IDE (free)

How to use megamek.client.bot.princess

Best Java code snippets using megamek.client.bot.princess (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: MegaMek/megamek

public InfantryPathRanker(Princess princess) {
  super(princess);
  setFireControl(new InfantryFireControl(princess));
  setPathEnumerator(princess.getPrecognition().getPathEnumerator());
}
origin: MegaMek/megamek

@Override
protected void checkMoral() {
  moralUtil.checkMoral(behaviorSettings.isForcedWithdrawal(),
             behaviorSettings.getBraveryIndex(),
             behaviorSettings.getSelfPreservationIndex(),
             getLocalPlayer(),
             game);
}
origin: MegaMek/megamek

/**
 * Princess's home edge.
 *
 * @param retreatEdge the index of the {@link CardinalEdge} princess should flee to.  See {@link CardinalEdge#getIndex()}
 */
public void setRetreatEdge(final int retreatEdge) {
  setRetreatEdge(CardinalEdge.getCardinalEdge(retreatEdge));
}
origin: MegaMek/megamek

ToHitData calcToHit() {
  return owner.getFireControl(getShooter()).guessToHitModifierForWeapon(getShooter(), getShooterState(), getTarget(),
                               getTargetState(),
                               getWeapon(), getGame());
}
origin: MegaMek/megamek

private ToHitData calcToHit(final MovePath shooterPath,
              final boolean assumeUnderFlightPath) {
  return owner.getFireControl(getShooter()).guessAirToGroundStrikeToHitModifier(getShooter(), null, getTarget(),
                                   getTargetState(),
                                   shooterPath, getWeapon(), getGame(),
                                   assumeUnderFlightPath);
}
origin: MegaMek/megamek

private void checkForBrokenEnemies() {
  // If the Forced Withdrawal rule is not turned on, then it's a fight 
  // to the death anyway.
  if (!getForcedWithdrawal()) {
    return;
  }
  for (final Entity entity : getEnemyEntities()) {
    getHonorUtil().checkEnemyBroken(entity, getForcedWithdrawal());
  }
}
origin: MegaMek/megamek

boolean getForcedWithdrawal() {
  return getBehaviorSettings().isForcedWithdrawal();
}
origin: MegaMek/megamek

/**
 * Princess's home edge.
 *
 * @param destinationEdge the index of the {@link CardinalEdge} princess should flee to.  See {@link CardinalEdge#getIndex()}
 */
public void setDestinationEdge(final int destinationEdge) {
  setDestinationEdge(CardinalEdge.getCardinalEdge(destinationEdge));
}
origin: MegaMek/megamek

/**
 * Helper function to perform some modifications to a given path.
 * Intended to happen after we pick the best path. 
 * @param path The ranked path to process
 * @return Altered move path
 */
private MovePath performPathPostProcessing(final RankedPath path) {
  return performPathPostProcessing(path.getPath(), path.getExpectedDamage());
}

origin: MegaMek/megamek

private int calcDamageDirection() {
  return ((calcAttackDirection() - getTargetState().getFacing()) + 6) % 6;
}
origin: MegaMek/megamek

public Set<Integer> getPriorityUnitTargets() {
  return getBehaviorSettings().getPriorityUnitTargets();
}
origin: MegaMek/megamek

/**
 * @return The amount of damage based on the damage of each weapon and their odds of hitting.
 */
synchronized double getExpectedDamage() {
  double expectedDamage = 0;
  for (WeaponFireInfo weaponFireInfo : this) {
    expectedDamage += weaponFireInfo.getExpectedDamageOnHit() * weaponFireInfo.getProbabilityToHit();
  }
  return expectedDamage;
}
origin: MegaMek/megamek

private EntityState getShooterState() {
  if (null == shooterState) {
    shooterState = new EntityState(getShooter());
  }
  return shooterState;
}
origin: MegaMek/megamek

  public static CardinalEdge getCardinalEdge(int index) {
    for (CardinalEdge he : values()) {
      if (he.getIndex() == index) {
        return he;
      }
    }
    return null;
  }
}
origin: MegaMek/megamek

@Override
protected void initTargeting() {
  getArtilleryTargetingControl().initializeForTargetingPhase();
}
origin: MegaMek/megamek

public void log(final Class<?> callingClass,
        final String methodName,
        final Throwable t) {
  log(callingClass, methodName, LogLevel.ERROR, t);
}
origin: MegaMek/megamek

Coords getClosestCoordsTo(int unitId, Coords location) {
  ConvexBoardArea box = pathEnumerator.getUnitMovableAreas().get(unitId);
  if (box == null) {
    return null;
  }
  return box.getClosestCoordsTo(location);
}
origin: MegaMek/megamek

/**
 * How quickly will I try to escape once damaged?
 *
 * @param index The index of the Bravery modifier to retrieve.
 * @return Bravery modifier value at given index.
 */
protected double getBraveryValue(final int index) {
  return BRAVERY[validateIndex(index)];
}
origin: MegaMek/megamek

  double getMaxDamageAtRange(InfantryFireControl fireControl, Entity shooter, MovePath movePath,
      int range, boolean useExtremeRange,
      boolean useLOSRange) {
    return fireControl.getMaxDamageAtRange(shooter, movePath, range, useExtremeRange,
                  useLOSRange);
  }
}
origin: MegaMek/megamek

/**
 * How worried about enemy damage am I?
 *
 * @param selfPreservationIndex The index [0-10] of the self preservation value to be used.
 */
public void setSelfPreservationIndex(final int selfPreservationIndex) {
  this.selfPreservationIndex = validateIndex(selfPreservationIndex);
}
megamek.client.bot.princess

Most used classes

  • BehaviorSettings
    Created with IntelliJ IDEA.
  • BehaviorSettingsFactory
    Created with IntelliJ IDEA.
  • Princess
  • BasicPathRanker
    A very basic pathranker
  • BotGeometry
    This contains useful classes and functions for geometric questions the bot algorithm might have
  • ChatCommands,
  • EntityEvaluationResponse,
  • EntityState,
  • FireControl,
  • FireControlState,
  • FiringPlan,
  • IHonorUtil,
  • PathRankerState,
  • PhysicalInfo,
  • PrincessException,
  • RankedPath,
  • WeaponFireInfo,
  • AeroPathUtil,
  • ArtilleryTargetingControl
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now