Record Class NegotiationData
java.lang.Object
java.lang.Record
mekhq.campaign.mission.contract.contractData.NegotiationData
public record NegotiationData(int originalPayStep, int originalSupportStep, int originalTransportStep, int originalSalvageStep, int originalCommandStep, int reputationUsed, int swapsUsed, int sacrificeBank, List<List<TermFunding>> funding)
extends Record
A record of how a contract's terms were negotiated, stored on the contract so the negotiation table can be reopened
and resumed rather than restarting from scratch.
The contract's live terms already hold the current (negotiated) step of each clause; this record adds what the negotiation UI cannot otherwise recover: the pre-negotiation baseline steps, the budgets already spent, and how each raised step was funded. Together they let the dialog restore the exact in-progress state and continue to enforce the per-term cap and reputation/swap limits across sessions.
The funding lists are in canonical clause order - pay, support, transport, salvage, command - matching
ContractTermsData; each inner list holds one TermFunding entry per step that clause was raised.
- Since:
- 0.51.01
-
Constructor Summary
ConstructorsConstructorDescriptionNegotiationData(int originalPayStep, int originalSupportStep, int originalTransportStep, int originalSalvageStep, int originalCommandStep, int reputationUsed, int swapsUsed, int sacrificeBank, List<List<TermFunding>> funding) Creates an instance of aNegotiationDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.funding()Returns the value of thefundingrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of theoriginalCommandSteprecord component.intReturns the value of theoriginalPaySteprecord component.intReturns the value of theoriginalSalvageSteprecord component.intReturns the value of theoriginalSupportSteprecord component.intReturns the value of theoriginalTransportSteprecord component.intReturns the value of thereputationUsedrecord component.intReturns the value of thesacrificeBankrecord component.intReturns the value of theswapsUsedrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NegotiationData
public NegotiationData(int originalPayStep, int originalSupportStep, int originalTransportStep, int originalSalvageStep, int originalCommandStep, int reputationUsed, int swapsUsed, int sacrificeBank, List<List<TermFunding>> funding) Creates an instance of aNegotiationDatarecord class.- Parameters:
originalPayStep- the value for theoriginalPaySteprecord componentoriginalSupportStep- the value for theoriginalSupportSteprecord componentoriginalTransportStep- the value for theoriginalTransportSteprecord componentoriginalSalvageStep- the value for theoriginalSalvageSteprecord componentoriginalCommandStep- the value for theoriginalCommandSteprecord componentreputationUsed- the value for thereputationUsedrecord componentswapsUsed- the value for theswapsUsedrecord componentsacrificeBank- the value for thesacrificeBankrecord componentfunding- the value for thefundingrecord component
-
-
Method Details
-
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 '=='. -
originalPayStep
public int originalPayStep()Returns the value of theoriginalPaySteprecord component.- Returns:
- the value of the
originalPaySteprecord component
-
originalSupportStep
public int originalSupportStep()Returns the value of theoriginalSupportSteprecord component.- Returns:
- the value of the
originalSupportSteprecord component
-
originalTransportStep
public int originalTransportStep()Returns the value of theoriginalTransportSteprecord component.- Returns:
- the value of the
originalTransportSteprecord component
-
originalSalvageStep
public int originalSalvageStep()Returns the value of theoriginalSalvageSteprecord component.- Returns:
- the value of the
originalSalvageSteprecord component
-
originalCommandStep
public int originalCommandStep()Returns the value of theoriginalCommandSteprecord component.- Returns:
- the value of the
originalCommandSteprecord component
-
reputationUsed
public int reputationUsed()Returns the value of thereputationUsedrecord component.- Returns:
- the value of the
reputationUsedrecord component
-
swapsUsed
public int swapsUsed()Returns the value of theswapsUsedrecord component.- Returns:
- the value of the
swapsUsedrecord component
-
sacrificeBank
public int sacrificeBank()Returns the value of thesacrificeBankrecord component.- Returns:
- the value of the
sacrificeBankrecord component
-
funding
Returns the value of thefundingrecord component.- Returns:
- the value of the
fundingrecord component
-