OpenTTD Source 20260208-master-g43af8e94d0
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)
EndianBufferReaderoperator>> (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
flagstype of operation
cargo_typeCargoType of subsidy.
srcSource.
dstDestination.
Returns
the cost of this operation or an error

Definition at line 196 of file subsidy.cpp.

References _current_company, CMD_ERROR, CreateSubsidy(), Execute, CargoSpec::Get(), Industry, 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.