2007-06-09 03:05:51 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 21:21:05 +01:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 16:11:33 +01:00
|
|
|
/** @file newgrf_industries.h Functions for NewGRF industries. */
|
2007-06-09 03:05:51 +01:00
|
|
|
|
|
|
|
#ifndef NEWGRF_INDUSTRIES_H
|
|
|
|
#define NEWGRF_INDUSTRIES_H
|
|
|
|
|
2010-02-21 17:01:23 +00:00
|
|
|
#include "command_type.h"
|
2010-08-26 23:01:16 +01:00
|
|
|
#include "company_type.h"
|
2007-06-09 03:05:51 +01:00
|
|
|
#include "newgrf_spritegroup.h"
|
|
|
|
|
2007-09-23 20:27:35 +01:00
|
|
|
/** When should the industry(tile) be triggered for random bits? */
|
|
|
|
enum IndustryTrigger {
|
|
|
|
/** Triggered each tile loop */
|
|
|
|
INDUSTRY_TRIGGER_TILELOOP_PROCESS = 1,
|
|
|
|
/** Triggered (whole industry) each 256 ticks */
|
|
|
|
INDUSTRY_TRIGGER_256_TICKS = 2,
|
|
|
|
/** Triggered on cargo delivery */
|
|
|
|
INDUSTRY_TRIGGER_CARGO_DELIVERY = 4,
|
|
|
|
};
|
|
|
|
|
2008-01-07 14:02:26 +00:00
|
|
|
/** From where is callback CBID_INDUSTRY_AVAILABLE been called */
|
|
|
|
enum IndustryAvailabilityCallType {
|
2010-10-16 14:15:54 +01:00
|
|
|
IACT_MAPGENERATION, ///< during random map generation
|
|
|
|
IACT_RANDOMCREATION, ///< during creation of random ingame industry
|
|
|
|
IACT_USERCREATION, ///< from the Fund/build window
|
|
|
|
IACT_PROSPECTCREATION, ///< from the Fund/build using prospecting
|
2008-01-07 14:02:26 +00:00
|
|
|
};
|
|
|
|
|
2007-06-13 03:29:08 +01:00
|
|
|
/* in newgrf_industry.cpp */
|
2007-06-09 03:05:51 +01:00
|
|
|
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available);
|
2007-07-25 20:06:29 +01:00
|
|
|
uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile);
|
2010-01-21 18:32:44 +00:00
|
|
|
uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i, uint32 cur_grfid);
|
2007-07-05 06:41:56 +01:00
|
|
|
void IndustryProductionCallback(Industry *ind, int reason);
|
2010-10-16 14:15:54 +01:00
|
|
|
CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint layout, uint32 seed, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type);
|
2007-07-15 01:19:40 +01:00
|
|
|
bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_type);
|
2010-08-07 21:11:27 +01:00
|
|
|
bool IndustryTemporarilyRefusesCargo(Industry *ind, CargoID cargo_type);
|
2007-06-09 03:05:51 +01:00
|
|
|
|
2007-07-11 23:57:47 +01:00
|
|
|
IndustryType MapNewGRFIndustryType(IndustryType grf_type, uint32 grf_id);
|
|
|
|
|
2007-06-13 03:29:08 +01:00
|
|
|
/* in newgrf_industrytiles.cpp*/
|
2010-10-19 22:00:45 +01:00
|
|
|
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index, bool signed_offsets = true);
|
2007-07-12 00:10:22 +01:00
|
|
|
|
2007-06-09 03:05:51 +01:00
|
|
|
#endif /* NEWGRF_INDUSTRIES_H */
|