Record Class WarriorsAlmanacEntry
java.lang.Object
java.lang.Record
mekhq.campaign.universe.warriorsAlmanac.WarriorsAlmanacEntry
- Record Components:
name- the display name of the part or unittechBase- the tech base of the part or unit, used for faction gating and the tech-base columncategoryOrder- the canonical ordinal of the category, used only to order the tabscategoryLabel- the localized category name, used as the tab titlecategoryIntro- the localized introductory blurb shown above the category's tablephase- the development phase that occurred this year
public record WarriorsAlmanacEntry(String name, megamek.common.enums.TechBase techBase, int categoryOrder, String categoryLabel, String categoryIntro, AlmanacTechAdvancementPhase phase)
extends Record
A single Warrior's Almanac development event: one part or unit reaching a particular
AlmanacTechAdvancementPhase (prototype, production, common, extinct, or reintroduced) in a given year.
Entries are grouped by the year the event occurred (see buildAlmanacPartsData(mekhq.campaign.market.PartsStore, boolean) and
buildAlmanacUnitsData()), then presented per-category (Warehouse part category / unit type) in the
WarriorsAlmanacDialog. categoryOrder preserves the canonical ordering used to lay out the tabs, while
categoryLabel is the localized tab title.
- Since:
- 0.50.07
-
Constructor Summary
ConstructorsConstructorDescriptionWarriorsAlmanacEntry(String name, megamek.common.enums.TechBase techBase, int categoryOrder, String categoryLabel, String categoryIntro, AlmanacTechAdvancementPhase phase) Creates an instance of aWarriorsAlmanacEntryrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<Integer, List<WarriorsAlmanacEntry>> buildAlmanacPartsData(PartsStore partsStore, boolean isClan) Builds the parts almanac, keyed by the year each development event occurred.static Map<Integer, List<WarriorsAlmanacEntry>> Builds the units almanac, keyed by the year each development event occurred.Returns the value of thecategoryIntrorecord component.Returns the value of thecategoryLabelrecord component.intReturns the value of thecategoryOrderrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.phase()Returns the value of thephaserecord component.megamek.common.enums.TechBasetechBase()Returns the value of thetechBaserecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
WarriorsAlmanacEntry
public WarriorsAlmanacEntry(String name, megamek.common.enums.TechBase techBase, int categoryOrder, String categoryLabel, String categoryIntro, AlmanacTechAdvancementPhase phase) Creates an instance of aWarriorsAlmanacEntryrecord class.- Parameters:
name- the value for thenamerecord componenttechBase- the value for thetechBaserecord componentcategoryOrder- the value for thecategoryOrderrecord componentcategoryLabel- the value for thecategoryLabelrecord componentcategoryIntro- the value for thecategoryIntrorecord componentphase- the value for thephaserecord component
-
-
Method Details
-
buildAlmanacPartsData
public static Map<Integer,List<WarriorsAlmanacEntry>> buildAlmanacPartsData(PartsStore partsStore, boolean isClan) Builds the parts almanac, keyed by the year each development event occurred.Omni-podded parts are skipped. The supplied
isClanflag selects the Inner Sphere or Clan tech-date perspective for the part, and should reflect the player force (seeForce#isClanForce).- Parameters:
partsStore- the parts store to enumerateisClan- whether to use Clan tech dates (true) or Inner Sphere tech dates (false)- Returns:
- a map of year to the development events that occurred that year
-
buildAlmanacUnitsData
Builds the units almanac, keyed by the year each development event occurred.Unit tech dates are tech-base agnostic (they are precomputed on the
MekSummary), so no perspective flag is required.- Returns:
- a map of year to the development events that occurred that year
-
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 '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
techBase
public megamek.common.enums.TechBase techBase()Returns the value of thetechBaserecord component.- Returns:
- the value of the
techBaserecord component
-
categoryOrder
public int categoryOrder()Returns the value of thecategoryOrderrecord component.- Returns:
- the value of the
categoryOrderrecord component
-
categoryLabel
Returns the value of thecategoryLabelrecord component.- Returns:
- the value of the
categoryLabelrecord component
-
categoryIntro
Returns the value of thecategoryIntrorecord component.- Returns:
- the value of the
categoryIntrorecord component
-
phase
Returns the value of thephaserecord component.- Returns:
- the value of the
phaserecord component
-