Class TContractLeg
Unit
Declaration
type TContractLeg = class(TObject)
Description
Represents a transport contract within a main contract.
Hierarchy
- TObject
- TContractLeg
Overview
Methods
![]() |
procedure AddOrSetTradeRouteLeg(const ID: Integer; const ATradeRouteLeg: TTradeRouteLeg; out AItemError: TTradeRouteLegItemError); |
![]() |
procedure RemoveTradeRouteLeg(const ID: Integer); |
![]() |
procedure TryGetTradeRouteLeg(const ID: Integer; out ATradeRouteLeg: TTradeRouteLeg); |
![]() |
function GetTradeRouteLegIDs: TIDArray; |
![]() |
function TradeRouteLegsContainsID(const ID: Integer) : Boolean; |
![]() |
function TradeRouteLegsToArray: TTradeRouteLegDictionaryPairArray; |
![]() |
constructor Create(const ALoadingName: String; const ACommodity: String; const ASCUMaxSize: TSCUSize); overload; |
![]() |
constructor Create(const ALoading: TLoadingRecord; const ASCUMaxSize: TSCUSize); overload; |
![]() |
destructor Destroy; override; |
![]() |
function GetGroupedUnloadings(const StationCommodityGrouping: Boolean): TUnloadingRecordArray; |
![]() |
function Clone: TContractLeg; |
![]() |
function LoadingToString: String; |
![]() |
function UnloadingsToString: String; |
![]() |
function ToString: String; override; |
![]() |
class function IsConformedTradeRouteLeg(ATradeRouteLeg: TTradeRouteLeg) : Boolean; static; |
Properties
![]() |
property Loading: TLoadingRecord read FLoading; |
![]() |
property Unloadings: TUnloadingRecordArray read GetUnloadings; |
![]() |
property UnloadingsCount: Integer read GetUnloadingsCount; |
![]() |
property SCUMaxSize: TSCUSize read FSCUMaxSize; |
Description
Methods
![]() |
procedure AddOrSetTradeRouteLeg(const ID: Integer; const ATradeRouteLeg: TTradeRouteLeg; out AItemError: TTradeRouteLegItemError); |
|
Adds or sets a trade route leg. Parameters
| |
![]() |
procedure RemoveTradeRouteLeg(const ID: Integer); |
|
Removes a trade route leg. Parameters
| |
![]() |
procedure TryGetTradeRouteLeg(const ID: Integer; out ATradeRouteLeg: TTradeRouteLeg); |
|
Tries to get a trade route leg. Parameters
| |
![]() |
function GetTradeRouteLegIDs: TIDArray; |
Returnsthe IDs of all trade route legs. | |
![]() |
function TradeRouteLegsContainsID(const ID: Integer) : Boolean; |
|
Parameters
Returns
| |
![]() |
function TradeRouteLegsToArray: TTradeRouteLegDictionaryPairArray; |
Returnsthe trade route legs as an array of dictionary pairs. | |
![]() |
constructor Create(const ALoadingName: String; const ACommodity: String; const ASCUMaxSize: TSCUSize); overload; |
|
Creates a new TContractLeg instance. Parameters
Exceptions raised
| |
![]() |
constructor Create(const ALoading: TLoadingRecord; const ASCUMaxSize: TSCUSize); overload; |
|
Creates a new TContractLeg instance. Parameters
| |
![]() |
destructor Destroy; override; |
|
Destructor. | |
![]() |
function GetGroupedUnloadings(const StationCommodityGrouping: Boolean): TUnloadingRecordArray; |
|
Groups the unloading stations by station and commodity. TODO: generalize for the custom filter Parameters
ReturnsTUnloadingRecordArray with all unloading stations. | |
![]() |
function Clone: TContractLeg; |
|
Returns a deep copy of the TContractLeg instance. | |
![]() |
function LoadingToString: String; |
|
Returns a string representation of the Loading field. | |
![]() |
function UnloadingsToString: String; |
|
Returns a string representation of the Unloadings field. | |
![]() |
function ToString: String; override; |
|
Returns a string representation of the TContractLeg instance. | |
![]() |
class function IsConformedTradeRouteLeg(ATradeRouteLeg: TTradeRouteLeg) : Boolean; static; |
|
Checks if the given TTradeRouteLeg conforms to the rules for being part of a TContractLeg. | |
Properties
![]() |
property Loading: TLoadingRecord read FLoading; |
|
Data relating to the loading station. | |
![]() |
property Unloadings: TUnloadingRecordArray read GetUnloadings; |
|
Data relating to the unloading stations. | |
![]() |
property UnloadingsCount: Integer read GetUnloadingsCount; |
|
Number of unloading stations. | |
![]() |
property SCUMaxSize: TSCUSize read FSCUMaxSize; |
|
Maximum container size. | |
