Package megamek.common
Class RecordingCompositeTechLevel
java.lang.Object
megamek.common.CompositeTechLevel
megamek.common.RecordingCompositeTechLevel
- All Implemented Interfaces:
Serializable,ITechnology
A
CompositeTechLevel that remembers every component folded into it, together with the state of the composite
immediately after that component was added.
This exists so that a tech level report can show which component is responsible for a unit's tech level, rather than
only the final answer. Because it records the real addComponent calls instead of re-deriving the component
list, it cannot drift from the calculation it is describing.
This class is a reporting aid and is never part of game state: it is not sent to clients and never reaches a saved
game. The recorded components are therefore held in a transient list and RecordingCompositeTechLevel.ComponentTechRecord is
deliberately not serializable.
- Since:
- 0.51.01
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA single component of a unit, as recorded while the composite tech level was being built.Nested classes/interfaces inherited from class megamek.common.CompositeTechLevel
CompositeTechLevel.DateRange -
Field Summary
Fields inherited from interface megamek.common.interfaces.ITechnology
DATE_ES, DATE_NONE, DATE_PS -
Constructor Summary
ConstructorsConstructorDescriptionRecordingCompositeTechLevel(Entity entity, Faction techFaction, int evaluationYear) Creates a composite tech level for the given unit that records each component as it is added. -
Method Summary
Modifier and TypeMethodDescriptionintprotected voidrecordComponent(ITechnology tech, String componentName) Called after every component has been folded into this composite.Methods inherited from class megamek.common.CompositeTechLevel
addComponent, addComponent, firstAvailableYearFrom, formatDateRanges, getAdvancedRange, getBaseAvailability, getCommonDate, getCommonDateRange, getEarliestTechDate, getExperimentalRange, getExtinctionDate, getExtinctionDate, getExtinctionRange, getIntroductionDate, getIntroductionDate, getProductionDate, getProductionDate, getProductionDateRange, getPrototypeDate, getPrototypeDate, getPrototypeDateRange, getReintroductionDate, getReintroductionDate, getStandardRange, getStaticTechLevel, getTechBase, getTechLevel, getTechRating, isClan, isMixedTech, setObsoleteYear, setObsoleteYearsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface megamek.common.interfaces.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getCodeFromIOAbbr, getCodeFromMMAbbr, getCommonDate, getEraAvailabilityName, getEraAvailabilityName, getExperimentalRange, getExtinctionDate, getExtinctionRange, getFullRatingName, getFullRatingName, getIntroductionDate, getProductionDate, getPrototypeDate, getReintroductionDate, getSimpleLevel, getSimpleLevel, getSimpleLevel, getStandardRange, getTechLevel, getTechRatingName, isAvailableIn, isAvailableIn, isAvailableIn, isExtinct, isExtinct, isExtinct, isIntroLevel, isLegal, isLegal, isUnofficial
-
Constructor Details
-
RecordingCompositeTechLevel
Creates a composite tech level for the given unit that records each component as it is added.- Parameters:
entity- The unit whose tech level is being builttechFaction- The faction to evaluate faction-specific dates forevaluationYear- The year to evaluate each component's variable tech level in
-
-
Method Details
-
recordComponent
Description copied from class:CompositeTechLevelCalled after every component has been folded into this composite. Does nothing by default; subclasses may override it to record the components that make up the composite. SeeRecordingCompositeTechLevel.- Overrides:
recordComponentin classCompositeTechLevel- Parameters:
tech- - the advancement of the component that was just addedcomponentName- - the name supplied for the component, ornullif none was given
-
getComponentRecords
- Returns:
- Every component of this unit, in the order it was added to the composite
-
getEvaluationYear
public int getEvaluationYear()- Returns:
- The year each component's variable tech level was evaluated in
-