Class TContract

Unit

Declaration

type TContract = class(TObject)

Description

Represents a complete contract, consisting of one or more station-to-station contracts.

Hierarchy

Overview

Methods

Public function GetContractLeg(const LoadingStationName: String; const Commodity: String): TContractLeg;
Public procedure AddContractLeg(const AContractLeg: TContractLeg);
Public function RemoveTradeRouteLeg(const PanelID: Integer; out Leg: TContractLeg): Boolean;
Public function RemoveContractLeg(const AContractLeg: TContractLeg): Boolean;
Public function Clone: TContract;
Public function ToString: String; override;
Public constructor Create(const AID: Integer; const ASCUMaxSize: TSCUSize);
Public destructor Destroy; override;
Public class procedure SetConsoleServer(AConsoleServer: TConsoleReaderThread); static;

Properties

Public property ID: Integer read FID;
Public property Contractor: String read FContractor;
Public property aUEC: Integer read FaUEC;
Public property SCUMaxSize: TSCUSize read FSCUMaxSize;
Public property ContractLegsCount : Integer read GetContractLegsCount;
Public property ContractLegs: TContractLegArray read GetContractLegs;
Public property ContractRouteType: TContractRouteType read FContractRouteType;
Public property ContractCargoRoute: TContractCargoRoute read FContractCargoRoute;
Public property UserRank: TUserRank read FUserRank;
Public property ContractCargoGradeScale: TContractCargoGradeScale read FContractCargoGradeScale;
Public property ContractCargoGradeScaleDirect: TContractCargoGradeScaleDirect read FContractCargoGradeScaleDirect;
Public property ContractTransportType: TContractTransportType read FContractTransportType;
Public property ContractDifficultyModifier: TContractDifficultyModifier read FContractDifficultyModifier;

Description

Methods

Public function GetContractLeg(const LoadingStationName: String; const Commodity: String): TContractLeg;

Parameters
LoadingStationName
The name of the loading station.
Commodity
The name of the commodity.
Returns

TContractLeg with the given loading station name and commodity.

Public procedure AddContractLeg(const AContractLeg: TContractLeg);

Adds a trade route leg.

Parameters
const
AContractLeg: TContractLeg
Exceptions raised
EContractException
if the trade route leg is not conformed.
Public function RemoveTradeRouteLeg(const PanelID: Integer; out Leg: TContractLeg): Boolean;

Removes a trade route leg. Leg is set to the removed trade route leg or nil if the trade route leg was not found.

Parameters
PanelID
The ID (PanelID) of the trade route leg.
Leg
The trade route leg.
Returns

True if the trade route leg was removed.

Public function RemoveContractLeg(const AContractLeg: TContractLeg): Boolean;

Removes a trade route Leg

Parameters
AContractLeg
The trade route leg.
Returns

True if the trade route leg was removed.

Public function Clone: TContract;

Returns a deep copy of the TContract instance.

Public function ToString: String; override;

Returns a string representation of the TContract instance.

Public constructor Create(const AID: Integer; const ASCUMaxSize: TSCUSize);

Creates a new TContract instance.

Parameters
const
AID: Integer
const
ASCUMaxSize: TSCUSize
Public destructor Destroy; override;

Destructor.

Public class procedure SetConsoleServer(AConsoleServer: TConsoleReaderThread); static;

Sets the console server.

Parameters
AConsoleServer
The console server.

Properties

Public property ID: Integer read FID;

ID of the contract.

Public property Contractor: String read FContractor;

Contractor

Public property aUEC: Integer read FaUEC;

Total mission payout in aUEC.

Public property SCUMaxSize: TSCUSize read FSCUMaxSize;

Maximum SCU size accepted for loading.

Public property ContractLegsCount : Integer read GetContractLegsCount;

Number of contract legs.

Public property ContractLegs: TContractLegArray read GetContractLegs;

Contracts that make up the mission.

Public property ContractRouteType: TContractRouteType read FContractRouteType;

Type of contract route.

Public property ContractCargoRoute: TContractCargoRoute read FContractCargoRoute;

Cargo route.

Public property UserRank: TUserRank read FUserRank;

User rank.

Public property ContractCargoGradeScale: TContractCargoGradeScale read FContractCargoGradeScale;

Cargo grade scale.

Public property ContractCargoGradeScaleDirect: TContractCargoGradeScaleDirect read FContractCargoGradeScaleDirect;

Cargo grade scale direct.

Public property ContractTransportType: TContractTransportType read FContractTransportType;

Transport type.

Public property ContractDifficultyModifier: TContractDifficultyModifier read FContractDifficultyModifier;

Difficulty modifier.