# CargoArray Struct Reference

Class for storing amounts of cargo. More...

`#include <cargo_type.h>`

## Public Member Functions

FORCEINLINE | CargoArray ()
| Default constructor.
FORCEINLINE void | Clear ()
| Reset all entries.
FORCEINLINE uint & | operator[] (CargoID cargo)
| Read/write access to an amount of a specific cargo type.
FORCEINLINE const uint & | operator[] (CargoID cargo) const
| Read-only access to an amount of a specific cargo type.

## Private Attributes

uint | amount [NUM_CARGO]
| Amount of each type of cargo.

## Detailed Description

Class for storing amounts of cargo.

Definition at line 73 of file cargo_type.h.

## Constructor & Destructor Documentation

FORCEINLINE CargoArray::CargoArray | ( |  | ) | `[inline]`

Default constructor.

Definition at line 79 of file cargo_type.h.

References Clear().

## Member Function Documentation

FORCEINLINE void CargoArray::Clear | ( |  | ) | `[inline]`

Reset all entries.

Definition at line 85 of file cargo_type.h.

References amount.

Referenced by CargoArray().

FORCEINLINE const uint& CargoArray::operator[] | ( | CargoID | cargo | ) | const`[inline]`

Read-only access to an amount of a specific cargo type.

Parameters:

  | cargo | Cargo type to access.

Definition at line 101 of file cargo_type.h.

References amount.

FORCEINLINE uint& CargoArray::operator[] | ( | CargoID | cargo | ) | `[inline]`

Read/write access to an amount of a specific cargo type.

Parameters:

  | cargo | Cargo type to access.

Definition at line 93 of file cargo_type.h.

References amount.

The documentation for this struct was generated from the following file:

- src/cargo_type.h