glx@9626: /* $Id$ */ glx@9626: rubidium@10455: /** @file newgrf_industries.h Functions for NewGRF industries. */ glx@9626: glx@9626: #ifndef NEWGRF_INDUSTRIES_H glx@9626: #define NEWGRF_INDUSTRIES_H glx@9626: rubidium@9723: #include "industry_type.h" glx@9626: #include "newgrf_spritegroup.h" glx@9626: glx@9704: /** When should the industry(tile) be triggered for random bits? */ glx@9704: enum IndustryTrigger { glx@9704: /** Triggered each tile loop */ glx@9704: INDUSTRY_TRIGGER_TILELOOP_PROCESS = 1, glx@9704: /** Triggered (whole industry) each 256 ticks */ glx@9704: INDUSTRY_TRIGGER_256_TICKS = 2, glx@9704: /** Triggered on cargo delivery */ glx@9704: INDUSTRY_TRIGGER_CARGO_DELIVERY = 4, glx@9704: }; glx@9704: rubidium@9723: /** From where is callback CBID_INDUSTRY_AVAILABLE been called */ rubidium@9723: enum IndustryAvailabilityCallType { rubidium@9723: IACT_MAPGENERATION, ///< during random map generation rubidium@9723: IACT_RANDOMCREATION, ///< during creation of random ingame industry rubidium@9723: IACT_USERCREATION, ///< from the Fund/build window rubidium@9723: }; rubidium@9723: rubidium@9628: /* in newgrf_industry.cpp */ glx@9626: uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available); rubidium@9694: uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile); glx@9704: uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i); rubidium@9631: void IndustryProductionCallback(Industry *ind, int reason); rubidium@9724: bool CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint itspec_index, uint32 seed); rubidium@9686: bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_type); truelight@9641: truelight@9641: IndustryType MapNewGRFIndustryType(IndustryType grf_type, uint32 grf_id); glx@9626: rubidium@9628: /* in newgrf_industrytiles.cpp*/ truelight@9641: uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index); truelight@9641: glx@9626: #endif /* NEWGRF_INDUSTRIES_H */