Record Class PriorityTargetChoices.Candidate

java.lang.Object
java.lang.Record
megamek.client.bot.princess.PriorityTargetChoices.Candidate
Record Components:
unitId - the unit's ID
unitName - the name shown, chassis and model
ownerId - the owning player's ID
ownerName - the owning player's name
team - the owning player's team
forceId - the unit's force, or Force.NO_FORCE
forceName - the force's name, or an empty string for a unit in no force
forceRole - whether the force is a convoy or an escort under unit orders
isEnemyOfBot - true when the unit is an enemy of the bot being set up; always true when the bot is not known yet
isAlwaysTarget - true for an enemy convoy unit, which the bot targets at priority 1 whatever the player picks
Enclosing class:
PriorityTargetChoices

public static record PriorityTargetChoices.Candidate(int unitId, String unitName, int ownerId, String ownerName, int team, int forceId, String forceName, PriorityTargetChoices.ForceRole forceRole, boolean isEnemyOfBot, boolean isAlwaysTarget) extends Record
One unit the player can pick.
  • Constructor Details

    • Candidate

      public Candidate(int unitId, String unitName, int ownerId, String ownerName, int team, int forceId, String forceName, PriorityTargetChoices.ForceRole forceRole, boolean isEnemyOfBot, boolean isAlwaysTarget)
      Creates an instance of a Candidate record class.
      Parameters:
      unitId - the value for the unitId record component
      unitName - the value for the unitName record component
      ownerId - the value for the ownerId record component
      ownerName - the value for the ownerName record component
      team - the value for the team record component
      forceId - the value for the forceId record component
      forceName - the value for the forceName record component
      forceRole - the value for the forceRole record component
      isEnemyOfBot - the value for the isEnemyOfBot record component
      isAlwaysTarget - the value for the isAlwaysTarget record component
  • Method Details

    • hasForce

      public boolean hasForce()
      Returns:
      true when the unit belongs to a force
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • unitId

      public int unitId()
      Returns the value of the unitId record component.
      Returns:
      the value of the unitId record component
    • unitName

      public String unitName()
      Returns the value of the unitName record component.
      Returns:
      the value of the unitName record component
    • ownerId

      public int ownerId()
      Returns the value of the ownerId record component.
      Returns:
      the value of the ownerId record component
    • ownerName

      public String ownerName()
      Returns the value of the ownerName record component.
      Returns:
      the value of the ownerName record component
    • team

      public int team()
      Returns the value of the team record component.
      Returns:
      the value of the team record component
    • forceId

      public int forceId()
      Returns the value of the forceId record component.
      Returns:
      the value of the forceId record component
    • forceName

      public String forceName()
      Returns the value of the forceName record component.
      Returns:
      the value of the forceName record component
    • forceRole

      public PriorityTargetChoices.ForceRole forceRole()
      Returns the value of the forceRole record component.
      Returns:
      the value of the forceRole record component
    • isEnemyOfBot

      public boolean isEnemyOfBot()
      Returns the value of the isEnemyOfBot record component.
      Returns:
      the value of the isEnemyOfBot record component
    • isAlwaysTarget

      public boolean isAlwaysTarget()
      Returns the value of the isAlwaysTarget record component.
      Returns:
      the value of the isAlwaysTarget record component