@@ -108,33 +108,33 @@ struct Industry : IndustryPool::PoolItem
/**
* Check if a given tile belongs to this industry.
* @param tile The tile to check.
* @return True if the tile is part of this industry.
*/
inline bool TileBelongsToIndustry(TileIndex tile) const
{
return IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == this->index;
}
inline int GetCargoProducedIndex(CargoID cargo) const
if (cargo == CT_INVALID) return -1;
if (!IsValidCargoID(cargo)) return -1;
const CargoID *pos = std::find(this->produced_cargo, endof(this->produced_cargo), cargo);
if (pos == endof(this->produced_cargo)) return -1;
return pos - this->produced_cargo;
inline int GetCargoAcceptedIndex(CargoID cargo) const
const CargoID *pos = std::find(this->accepts_cargo, endof(this->accepts_cargo), cargo);
if (pos == endof(this->accepts_cargo)) return -1;
return pos - this->accepts_cargo;
* Get the industry of the given tile
* @param tile the tile to get the industry from
* @pre IsTileType(t, MP_INDUSTRY)
* @return the industry
static inline Industry *GetByTile(TileIndex tile)