You often need to compute the total cost of something in minerals. Doing this mineral-by-mineral is cumbersome, that's why there are some functions to manipulate cargo sets. Cargo sets are nothing more than specially formatted strings.

For example, the price of a Mark 8 torpedo is 1 kt of Tritanium, Molybdenum and Duranium, and 54 megacredits. In PCC, this cost can be represented as "1tdm 54$". The price of 13 torpedoes is then easily computed using

 CMul("1tdm 54$", 13)

A cargo set consists of a sequence of numbers followed by units (cargo types). The following cargo types are defined:

n t d mThe four standard minerals
$Money (megacredits)
sSupplies
cColonist clans
fFighters
wTorpedoes

Like you see in the above example, you can attach multiple units to each number ("1tdm" is one kt Tritanium, one kt Duranium, and one kt Molybdenum). And, you can write multiple such blocks. Note that there must not be a space between the number and the units.

For compatibility with PHost, PCC also accepts PHost's notation where a single cargo type precedes the number. For example, the cost of a Mark 8 torpedo would be "T1 D1 M1 $54" in PHost format.

Commands and Functions taking Cargo as Parameter

Functions returning Cargo

Properties of type Cargo

This is a testing version.
It may be incomplete, and have more bugs (or features) than the public live version at planetscentral.com.