Unit ContractUnit

Description

Provides tools for managing mission data, contracts, and routes.

Overview

Classes, Interfaces, Objects and Records

Name Description
Record TLoadingRecord Contains data relating to the loading station and the total number of crates loaded.
Record TUnloadingRecord Contains data for one of the crate drop-off stations, including the count of unloaded crates categorized by size.
Record TTradeRouteLeg Leg of Trade Route

Record TItemsStringListRecord String records for filling in TCheckBox
Class TContractLeg Represents a transport contract within a main contract.
Class TContract Represents a complete contract, consisting of one or more station-to-station contracts.
Class EContractException Exception class for contract-related errors.

Types

TContractRouteType = (...);
TContractRouteTypeArray = array[TContractRouteType] of String;
TContractCargoRoute = (...);
TContractCargoRouteArray = array[TContractCargoRoute] of String;
TUserRank = (...);
TUserRankArray = array[TUserRank] of String;
TContractCargoGradeScale = (...);
TContractCargoGradeScaleArray = array[TContractCargoGradeScale] of String;
TContractCargoGradeScaleDirect = (...);
TContractCargoGradeScaleDirectArray = array[TContractCargoGradeScaleDirect] of String;
TContractTransportType = (...);
TContractTransportTypeArray = array[TContractTransportType] of String;
TContractDifficultyModifier = (...);
TContractDifficultyModifierArray = array[TContractDifficultyModifier] of String;
TTradeRouteLegList = specialize TList<TTradeRouteLeg>;
TTradeRouteLegArray = array of TTradeRouteLeg;
TTradeRouteLegItem = (...);
TTradeRouteLegItemArray = array[TTradeRouteLegItem] of String;
TTradeRouteLegItemError = (...);
TTradeRouteLegChanged = procedure(Sender: TObject; AItem: TTradeRouteLegItem) of object;
TUnloadingRecordArray = array of TUnloadingRecord;
TIDArray = array of Integer;
TIDSet = specialize THashSet<Integer>;
TTradeRouteLegDictionary = specialize TDictionary<Integer, TTradeRouteLeg>;
TTradeRouteLegDictionaryPair = TTradeRouteLegDictionary.TDictionaryPair;
TTradeRouteLegDictionaryPairArray = array of TTradeRouteLegDictionaryPair;
TContractLegList = specialize TList<TContractLeg>;
TContractLegArray = array of TContractLeg;
TContractArray = array of TContract;
TContractDictionary = specialize TDictionary<Integer, TContract>;
TContractDictionaryPair = TContractDictionary.TDictionaryPair;
TContractDictionaryPairArray = array of TContractDictionaryPair;
TContractObjectDictionary = specialize TObjectDictionary<Integer, TContract>;
TContractObjectDictionaryPair = TContractObjectDictionary.TDictionaryPair;
TContractObjectDictionaryPairArray = array of TContractObjectDictionaryPair;
TPanelLegNotify = procedure(const Sender: TObject; const PanelID: Integer; const AItem: TTradeRouteLegItem; const Leg: TTradeRouteLeg) of object;
TPanelContractNotify = procedure( const Sender: TObject; const GroupID: Integer; const AContract: TContract) of object;

Constants

ContractRouteTypeArray: TContractRouteTypeArray = ('Undefined', 'A to B', 'Single to Multi', 'Multi to Single');
ContractCargoRouteArray: TContractCargoRouteArray = ('Undefined', 'Local', 'Planetary', 'Stellar', 'Interstellar');
UserRankArray: TUserRankArray = ('Undefined', 'Trainee', 'Rookie', 'Junior', 'Member', 'Experienced', 'Senior', 'Master');
ContractCargoGradeScaleArray: TContractCargoGradeScaleArray = ('Undefined', 'Small', 'Extra Small', 'Medium', 'Large', 'Extra Large', 'Cargo Transfer from Shuttered Facility', 'Small Scale', 'Medium Shipment', 'Large Shipment', 'Bulk Shipment');
ContractCargoGradeScaleDirectArray: TContractCargoGradeScaleDirectArray = ('Undefined', 'Direct', 'No Direct');
ContractTransportTypeArray: TContractTransportTypeArray = ('Undefined', 'Hauling', 'Delivery');
ContractDifficultyModifierArray: TContractDifficultyModifierArray = ('Undefined', 'Regular', 'Combat', 'Illegal');
TradeRouteLegItemArray: TTradeRouteLegItemArray = ('Undefined', 'Ignored', 'GroupId', 'GroupIdEnabled', 'LoadingStationName', 'UnloadingStationName', 'Commodity', 'SCU', 'SCUMaxSize', 'Done', 'Hide', 'SCUxSize');
TradeRouteLegItemErrorArray: array[TTradeRouteLegItemError] of String = ('None', 'Ignored', 'Generic Error', 'GroupId Error', 'LoadingStationName Error', 'UnloadingStationName Error', 'Commodity Error', 'SCU Error', 'SCUMaxSize Error', 'Done Error', 'Hide Error', 'SCUxSize Error');

Description

Types

TContractRouteType = (...);

Type of contract route.

Values
  • crtUndefined: Undefined route.
  • crtAtoB: A to B route.
  • crtSingleToMulti: Single to Multi route.
  • crtMultiToSingle: Multi to Single route.
TContractRouteTypeArray = array[TContractRouteType] of String;

Array of contract route types.

TContractCargoRoute = (...);

Type of contract cargo route.

Values
  • ccrUNDEFINED: Undefined route.
  • ccrLOCAL: Local route.
  • ccrPLANETARY: Planetary route.
  • ccrSTELLAR: Stellar route.
  • ccrINTERSTELLAR: Interstellar route.
TContractCargoRouteArray = array[TContractCargoRoute] of String;

Array of contract cargo route types.

TUserRank = (...);

Type of user rank.

Values
  • urUNDEFINED: Undefined rank.
  • urTRAINEE: Trainee rank.
  • urROOKIE: Rookie rank.
  • urJUNIOR: Junior rank.
  • urMEMBER: Member rank.
  • urEXPERIENCED: Experienced rank.
  • urSENIOR: Senior rank.
  • urMASTER: Master rank.
TUserRankArray = array[TUserRank] of String;

Array of user ranks.

TContractCargoGradeScale = (...);

Type of contract cargo grade scale.

Values
  • ccgsUNDEFINED: Undefined scale.
  • ccgsSMALL: Small scale.
  • ccgsEXTRA_SMALL: Extra Small scale.
  • ccgsMEDIUM: Medium scale.
  • ccgsLARGE: Large scale.
  • ccgsEXTRA_LARGE: Extra Large scale.
  • ccgsCARGO_TRANSFER_FROM_SHUTTERED_FACILITY: Cargo Transfer from Shuttered Facility scale.
  • ccgsSMALL_SCALE: Small Scale.
  • ccgsMEDIUM_SHIPMENT: Medium Shipment.
  • ccgsLARGE_SHIPMENT: Large Shipment.
  • ccgsBULK_SHIPMENT: Bulk Shipment.
TContractCargoGradeScaleArray = array[TContractCargoGradeScale] of String;

Array of contract cargo grade scale types.

TContractCargoGradeScaleDirect = (...);

Type of contract cargo grade scale direct.

Values
  • ccgsdUNDEFINED: Undefined direct.
  • ccgsdDIRECT: Direct scale.
  • ccgsdNO_DIRECT: No Direct scale.
TContractCargoGradeScaleDirectArray = array[TContractCargoGradeScaleDirect] of String;

Array of contract cargo grade scale direct types.

TContractTransportType = (...);

Type of contract transport.

Values
  • cttUNDEFINED: Undefined transport.
  • cttHAULING: Hauling transport.
  • cttDELIVERY: Delivery transport.
TContractTransportTypeArray = array[TContractTransportType] of String;

Array of contract transport types.

TContractDifficultyModifier = (...);

Type of contract difficulty modifier.

Values
  • cdmUndefined: Undefined difficulty.
  • cdmRegular: Regular difficulty.
  • cdmCombat: Combat difficulty.
  • cdmIllegal: Illegal difficulty.
TContractDifficultyModifierArray = array[TContractDifficultyModifier] of String;

Array of contract difficulty modifier types.

TTradeRouteLegList = specialize TList<TTradeRouteLeg>;

List of TTradeRouteLeg.

TTradeRouteLegArray = array of TTradeRouteLeg;

Array of TTradeRouteLeg.

TTradeRouteLegItem = (...);

Enumeration of utilities for TTradeRouteLeg

Values
  • eUndefined: Undefined.
  • eIgnored: Ignored.
  • eGroupId: GroupId.
  • eGroupIdEnabled: GroupIdEnabled.
  • eLoadingStationName: LoadingStationName.
  • eUnloadingStationName: UnloadingStationName.
  • eCommodity: Commodity.
  • eSCU: SCU.
  • eSCUMaxSize: SCUMaxSize.
  • eDone: Done.
  • eHide: Hide.
  • eSCUxSize: SCUxSize.
TTradeRouteLegItemArray = array[TTradeRouteLegItem] of String;

Array of TTradeRouteLegItem.

TTradeRouteLegItemError = (...);

Enumeration of utilities for TTradeRouteLeg

Values
  • erNone: No error.
  • erIgnored: Ignored.
  • erGeneric: Generic error.
  • erGroupId: GroupId error.
  • erLoadingStationName: LoadingStationName error.
  • erUnloadingStationName: UnloadingStationName error.
  • erCommodity: Commodity error.
  • erSCU: SCU error.
  • erSCUMaxSize: SCUMaxSize error.
  • erDone: Done error.
  • erHide: Hide error.
  • erSCUxSize: SCUxSize error.
TTradeRouteLegChanged = procedure(Sender: TObject; AItem: TTradeRouteLegItem) of object;

Notification when a single trade route leg changes. Sender = TPanelRow.

TUnloadingRecordArray = array of TUnloadingRecord;

Array of TUnloadingRecord.

TIDArray = array of Integer;

Array of Trade Route Leg IDs.

TIDSet = specialize THashSet<Integer>;

Set of Integer.

TTradeRouteLegDictionary = specialize TDictionary<Integer, TTradeRouteLeg>;

Dictionary of TTradeRouteLeg.

TTradeRouteLegDictionaryPair = TTradeRouteLegDictionary.TDictionaryPair;

Dictionary pair of TTradeRouteLeg.

TTradeRouteLegDictionaryPairArray = array of TTradeRouteLegDictionaryPair;

Array of dictionary pairs of TTradeRouteLeg.

TContractLegList = specialize TList<TContractLeg>;

List of TContractLeg.

TContractLegArray = array of TContractLeg;

Array of TContractLeg.

TContractArray = array of TContract;

List of TContract.

TContractDictionary = specialize TDictionary<Integer, TContract>;

Dictionary of TContract.

TContractDictionaryPair = TContractDictionary.TDictionaryPair;

Dictionary pair of TContract.

TContractDictionaryPairArray = array of TContractDictionaryPair;

Array of dictionary pairs of TContract.

TContractObjectDictionary = specialize TObjectDictionary<Integer, TContract>;

Object dictionary of TContract.

[doOwnsValues]             -> release the values
[doOwnsKeys]               -> release the keys
[doOwnsKeys, doOwnsValues] -> free both

TContractObjectDictionary.Create([doOwnsValues]);

TContractObjectDictionaryPair = TContractObjectDictionary.TDictionaryPair;

Object dictionary pair of TContract.

TContractObjectDictionaryPairArray = array of TContractObjectDictionaryPair;

Array of object dictionary pairs of TContract.

TPanelLegNotify = procedure(const Sender: TObject; const PanelID: Integer; const AItem: TTradeRouteLegItem; const Leg: TTradeRouteLeg) of object;

Notification when a single panel/leg changes. Sender = TContractDB.

Parameters
Sender
The sender object.
PanelID
The panel ID.
AItem
The trade route leg item.
Leg
The trade route leg.
TPanelContractNotify = procedure( const Sender: TObject; const GroupID: Integer; const AContract: TContract) of object;

Notification when a contract changes. Sender = TContractDB.

Parameters
Sender
The sender object.
GroupID
The group ID.
AContract
The contract.

Constants

ContractRouteTypeArray: TContractRouteTypeArray = ('Undefined', 'A to B', 'Single to Multi', 'Multi to Single');

Labels for TContractRouteType.

ContractCargoRouteArray: TContractCargoRouteArray = ('Undefined', 'Local', 'Planetary', 'Stellar', 'Interstellar');

Labels for TContractCargoRoute.

UserRankArray: TUserRankArray = ('Undefined', 'Trainee', 'Rookie', 'Junior', 'Member', 'Experienced', 'Senior', 'Master');

Labels for TUserRank.

ContractCargoGradeScaleArray: TContractCargoGradeScaleArray = ('Undefined', 'Small', 'Extra Small', 'Medium', 'Large', 'Extra Large', 'Cargo Transfer from Shuttered Facility', 'Small Scale', 'Medium Shipment', 'Large Shipment', 'Bulk Shipment');

Labels for TContractCargoGradeScale.

ContractCargoGradeScaleDirectArray: TContractCargoGradeScaleDirectArray = ('Undefined', 'Direct', 'No Direct');

Labels for TContractCargoGradeScaleDirect.

ContractTransportTypeArray: TContractTransportTypeArray = ('Undefined', 'Hauling', 'Delivery');

Labels for TContractTransportType.

ContractDifficultyModifierArray: TContractDifficultyModifierArray = ('Undefined', 'Regular', 'Combat', 'Illegal');

Labels for TContractDifficultyModifier.

TradeRouteLegItemArray: TTradeRouteLegItemArray = ('Undefined', 'Ignored', 'GroupId', 'GroupIdEnabled', 'LoadingStationName', 'UnloadingStationName', 'Commodity', 'SCU', 'SCUMaxSize', 'Done', 'Hide', 'SCUxSize');

Labels for TTradeRouteLegItem.

TradeRouteLegItemErrorArray: array[TTradeRouteLegItemError] of String = ('None', 'Ignored', 'Generic Error', 'GroupId Error', 'LoadingStationName Error', 'UnloadingStationName Error', 'Commodity Error', 'SCU Error', 'SCUMaxSize Error', 'Done Error', 'Hide Error', 'SCUxSize Error');

Labels for TTradeRouteLegItemError.