2007-06-09 02:05:51 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00: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 15:11:33 +00:00
|
|
|
/** @file newgrf_industries.h Functions for NewGRF industries. */
|
2007-06-09 02:05:51 +00:00
|
|
|
|
|
|
|
#ifndef NEWGRF_INDUSTRIES_H
|
|
|
|
#define NEWGRF_INDUSTRIES_H
|
|
|
|
|
2010-02-21 17:01:23 +00:00
|
|
|
#include "command_type.h"
|
2010-08-26 22:01:16 +00:00
|
|
|
#include "company_type.h"
|
2007-06-09 02:05:51 +00:00
|
|
|
#include "newgrf_spritegroup.h"
|
|
|
|
|
2007-09-23 19:27:35 +00: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 13:15:54 +00: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 02:29:08 +00:00
|
|
|
/* in newgrf_industry.cpp */
|
2007-06-09 02:05:51 +00:00
|
|
|
uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available);
|
2007-07-25 19:06:29 +00: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 05:41:56 +00:00
|
|
|
void IndustryProductionCallback(Industry *ind, int reason);
|
2010-10-16 13:15:54 +00:00
|
|
|
CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint layout, uint32 seed, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type);
|
2007-07-15 00:19:40 +00:00
|
|
|
bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_type);
|
2010-08-07 20:11:27 +00:00
|
|
|
bool IndustryTemporarilyRefusesCargo(Industry *ind, CargoID cargo_type);
|
2007-06-09 02:05:51 +00:00
|
|
|
|
2007-07-11 22:57:47 +00:00
|
|
|
IndustryType MapNewGRFIndustryType(IndustryType grf_type, uint32 grf_id);
|
|
|
|
|
2007-06-13 02:29:08 +00:00
|
|
|
/* in newgrf_industrytiles.cpp*/
|
2010-10-19 21:00:45 +00:00
|
|
|
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index, bool signed_offsets = true);
|
2007-07-11 23:10:22 +00:00
|
|
|
|
2007-06-09 02:05:51 +00:00
|
|
|
#endif /* NEWGRF_INDUSTRIES_H */
|