# cargotype.cpp File Reference

Implementation of cargos. More...

`#include "stdafx.h"`
`#include "newgrf_cargo.h"`
`#include "cargotype.h"`
`#include "core/bitmath_func.hpp"`
`#include "table/sprites.h"`
`#include "table/strings.h"`
`#include "table/cargo_const.h"`

Go to the source code of this file.

## Functions
void | SetupCargoForClimate (LandscapeID l)
const CargoSpec * | GetCargo (CargoID c)
CargoID | GetCargoIDByLabel (CargoLabel cl)
CargoID | GetCargoIDByBitnum (uint8 bitnum)
| Find the CargoID of a 'bitnum' value.
## Variables
CargoSpec | _cargo [NUM_CARGO]
static const byte | INVALID_CARGO = 0xFF
uint32 | _cargo_mask

## Detailed Description

Implementation of cargos.

Definition in file cargotype.cpp.

## Function Documentation

CargoID GetCargoIDByBitnum | ( | uint8 | bitnum | ) |

Find the CargoID of a 'bitnum' value.

Parameters:

  | bitnum | 'bitnum' to find.

Returns:
  First CargoID with the given bitnum, or CT_INVALID if not found.

Definition at line 87 of file cargotype.cpp.

References lengthof.