OpenTTD Source: src/subsidy_cmd.h File Reference

OpenTTD Source 15.3

Functions
subsidy_cmd.h File Reference

Command definitions related to subsidies. More...

`#include "command_type.h"`
`#include "cargo_type.h"`
`#include "source_type.h"`
`#include "misc/endian_buffer.hpp"`

Go to the source code of this file.

## Functions
CommandCost | CmdCreateSubsidy (DoCommandFlags flags, CargoType cargo_type, Source src, Source dst)
| Create a new subsidy.
template<typename Tcont , typename Titer >
EndianBufferWriter< Tcont, Titer > & | operator<< (EndianBufferWriter< Tcont, Titer > &buffer, const Source &source)
EndianBufferReader & | operator>> (EndianBufferReader &buffer, Source &source)

## Detailed Description

Command definitions related to subsidies.

Definition in file subsidy_cmd.h.

## Function Documentation

## ◆ CmdCreateSubsidy()

CommandCost CmdCreateSubsidy | ( | DoCommandFlags | flags,
|  | CargoType | cargo_type,
|  | Source | src,
|  | Source | dst
| ) |  |

Create a new subsidy.

Parameters

  flags | type of operation
  cargo_type | CargoType of subsidy.
  src | Source.
  dst | Destination.

Returns
  the cost of this operation or an error

Definition at line 196 of file subsidy.cpp.

References _current_company, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_subsidy_pool >::CanAllocateItem(), CMD_ERROR, CreateSubsidy(), Execute, CargoSpec::Get(), Industry, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_industry_pool >::IsValidID(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_town_pool >::IsValidID(), NUM_CARGO, OWNER_DEITY, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Town, and Source::type.

## ◆ operator<<()

template<typename Tcont , typename Titer >

EndianBufferWriter< Tcont, Titer > & operator<< | ( | EndianBufferWriter< Tcont, Titer > & | buffer,
|  | const Source & | source
| ) |  |
| inline

Definition at line 18 of file subsidy_cmd.h.

## ◆ operator>>()

EndianBufferReader & operator>> | ( | EndianBufferReader & | buffer,
|  | Source & | source
| ) |  |
| inline

Definition at line 29 of file subsidy_cmd.h.