OpenTTD
Data Structures | Typedefs | Enumerations | Variables
cargo_type.h File Reference

Types related to cargoes... More...

#include "core/enum_type.hpp"

Go to the source code of this file.

Data Structures

struct  CargoArray
 Class for storing amounts of cargo. More...
 

Typedefs

typedef byte CargoID
 Cargo slots to indicate a cargo type within a game. More...
 
typedef SimpleTinyEnumT< SourceType, byte > SourceTypeByte
 The SourceType packed into a byte for savegame purposes.
 
typedef uint16 SourceID
 Contains either industry ID, town ID or company ID (or INVALID_SOURCE)
 

Enumerations

enum  CargoTypes {
  CT_PASSENGERS = 0, CT_COAL = 1, CT_MAIL = 2, CT_OIL = 3,
  CT_LIVESTOCK = 4, CT_GOODS = 5, CT_GRAIN = 6, CT_WOOD = 7,
  CT_IRON_ORE = 8, CT_STEEL = 9, CT_VALUABLES = 10, CT_WHEAT = 6,
  CT_HILLY_UNUSED = 8, CT_PAPER = 9, CT_GOLD = 10, CT_FOOD = 11,
  CT_RUBBER = 1, CT_FRUIT = 4, CT_MAIZE = 6, CT_COPPER_ORE = 8,
  CT_WATER = 9, CT_DIAMONDS = 10, CT_SUGAR = 1, CT_TOYS = 3,
  CT_BATTERIES = 4, CT_CANDY = 5, CT_TOFFEE = 6, CT_COLA = 7,
  CT_COTTON_CANDY = 8, CT_BUBBLES = 9, CT_PLASTIC = 10, CT_FIZZY_DRINKS = 11,
  NUM_CARGO = 32, CT_AUTO_REFIT = 0xFD, CT_NO_REFIT = 0xFE, CT_INVALID = 0xFF
}
 Available types of cargo. More...
 
enum  SourceType { ST_INDUSTRY, ST_TOWN, ST_HEADQUARTERS }
 Types of cargo source and destination. More...
 

Variables

static const SourceID INVALID_SOURCE = 0xFFFF
 Invalid/unknown index of source.
 

Detailed Description

Types related to cargoes...

Definition in file cargo_type.h.

Typedef Documentation

◆ CargoID

typedef byte CargoID

Cargo slots to indicate a cargo type within a game.

Numbers are re-used between different climates.

See also
CargoTypes

Definition at line 22 of file cargo_type.h.

Enumeration Type Documentation

◆ CargoTypes

enum CargoTypes

Available types of cargo.

Enumerator
NUM_CARGO 

Maximal number of cargo types in a game.

CT_AUTO_REFIT 

Automatically choose cargo type when doing auto refitting.

CT_NO_REFIT 

Do not refit cargo of a vehicle (used in vehicle orders and auto-replace/auto-new).

CT_INVALID 

Invalid cargo type.

Definition at line 25 of file cargo_type.h.

◆ SourceType

enum SourceType

Types of cargo source and destination.

Enumerator
ST_INDUSTRY 

Source/destination is an industry.

ST_TOWN 

Source/destination is a town.

ST_HEADQUARTERS 

Source/destination are company headquarters.

Definition at line 139 of file cargo_type.h.