2007-06-09 02:05:51 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
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
|
|
|
|
|
2008-01-07 14:02:26 +00:00
|
|
|
#include "industry_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 {
|
|
|
|
IACT_MAPGENERATION, ///< during random map generation
|
|
|
|
IACT_RANDOMCREATION, ///< during creation of random ingame industry
|
|
|
|
IACT_USERCREATION, ///< from the Fund/build window
|
|
|
|
};
|
|
|
|
|
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);
|
2007-09-23 19:55:42 +00:00
|
|
|
uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i);
|
2007-07-05 05:41:56 +00:00
|
|
|
void IndustryProductionCallback(Industry *ind, int reason);
|
2008-01-29 00:36:55 +00:00
|
|
|
bool CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint itspec_index, uint32 seed);
|
2007-07-15 00:19:40 +00:00
|
|
|
bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_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*/
|
2007-07-11 23:10:22 +00:00
|
|
|
uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index);
|
|
|
|
|
2007-06-09 02:05:51 +00:00
|
|
|
#endif /* NEWGRF_INDUSTRIES_H */
|