Package megamek.client.bot.princess
Record Class PriorityTargetChoices.Candidate
java.lang.Object
java.lang.Record
megamek.client.bot.princess.PriorityTargetChoices.Candidate
- Record Components:
unitId- the unit's IDunitName- the name shown, chassis and modelownerId- the owning player's IDownerName- the owning player's nameteam- the owning player's teamforceId- the unit's force, orForce.NO_FORCEforceName- the force's name, or an empty string for a unit in no forceforceRole- whether the force is a convoy or an escort under unit ordersisEnemyOfBot-truewhen the unit is an enemy of the bot being set up; alwaystruewhen the bot is not known yetisAlwaysTarget-truefor 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 Summary
ConstructorsConstructorDescriptionCandidate(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 aCandidaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intforceId()Returns the value of theforceIdrecord component.Returns the value of theforceNamerecord component.Returns the value of theforceRolerecord component.booleanhasForce()final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisAlwaysTargetrecord component.booleanReturns the value of theisEnemyOfBotrecord component.intownerId()Returns the value of theownerIdrecord component.Returns the value of theownerNamerecord component.intteam()Returns the value of theteamrecord component.final StringtoString()Returns a string representation of this record class.intunitId()Returns the value of theunitIdrecord component.unitName()Returns the value of theunitNamerecord component.
-
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 aCandidaterecord class.- Parameters:
unitId- the value for theunitIdrecord componentunitName- the value for theunitNamerecord componentownerId- the value for theownerIdrecord componentownerName- the value for theownerNamerecord componentteam- the value for theteamrecord componentforceId- the value for theforceIdrecord componentforceName- the value for theforceNamerecord componentforceRole- the value for theforceRolerecord componentisEnemyOfBot- the value for theisEnemyOfBotrecord componentisAlwaysTarget- the value for theisAlwaysTargetrecord component
-
-
Method Details
-
hasForce
public boolean hasForce()- Returns:
truewhen the unit belongs to a force
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
unitId
public int unitId()Returns the value of theunitIdrecord component.- Returns:
- the value of the
unitIdrecord component
-
unitName
Returns the value of theunitNamerecord component.- Returns:
- the value of the
unitNamerecord component
-
ownerId
public int ownerId()Returns the value of theownerIdrecord component.- Returns:
- the value of the
ownerIdrecord component
-
ownerName
Returns the value of theownerNamerecord component.- Returns:
- the value of the
ownerNamerecord component
-
team
public int team()Returns the value of theteamrecord component.- Returns:
- the value of the
teamrecord component
-
forceId
public int forceId()Returns the value of theforceIdrecord component.- Returns:
- the value of the
forceIdrecord component
-
forceName
Returns the value of theforceNamerecord component.- Returns:
- the value of the
forceNamerecord component
-
forceRole
Returns the value of theforceRolerecord component.- Returns:
- the value of the
forceRolerecord component
-
isEnemyOfBot
public boolean isEnemyOfBot()Returns the value of theisEnemyOfBotrecord component.- Returns:
- the value of the
isEnemyOfBotrecord component
-
isAlwaysTarget
public boolean isAlwaysTarget()Returns the value of theisAlwaysTargetrecord component.- Returns:
- the value of the
isAlwaysTargetrecord component
-