Skip to content

Commit

Permalink
Merge pull request #6006 from IllianiCBT/isBattleArmor
Browse files Browse the repository at this point in the history
Added Shortcut Method to Check if a Unit is Battle Armor
  • Loading branch information
IllianiCBT authored Feb 8, 2025
2 parents 2b5db3a + d4e90ee commit 86fc6da
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions MekHQ/src/mekhq/campaign/unit/Unit.java
Original file line number Diff line number Diff line change
Expand Up @@ -6044,6 +6044,22 @@ public boolean isConventionalInfantry() {
return (getEntity() != null) && getEntity().isConventionalInfantry();
}

/**
* Checks if the associated entity is classified as battle armor.
*
* <p>
* This method determines whether the entity linked to this object is
* considered battle armor. It first verifies that the entity is not null,
* and then checks if the entity meets the criteria for battle armor.
* </p>
*
* @return {@code true} if the entity is classified as battle armor and is not null,
* otherwise {@code false}.
*/
public boolean isBattleArmor() {
return (getEntity() != null) && getEntity().isBattleArmor();
}

public boolean isIntroducedBy(int year) {
return null != entity && entity.getYear() <= year;
}
Expand Down

0 comments on commit 86fc6da

Please sign in to comment.