# newgrf_industries.h

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef NEWGRF_INDUSTRIES_H
    00013 #define NEWGRF_INDUSTRIES_H
    00014
    00015 #include "command_type.h"
    00016 #include "company_type.h"
    00017 #include "newgrf_spritegroup.h"
    00018
    00020 enum IndustryTrigger {
    00022   INDUSTRY_TRIGGER_TILELOOP_PROCESS = 1,
    00024   INDUSTRY_TRIGGER_256_TICKS        = 2,
    00026   INDUSTRY_TRIGGER_CARGO_DELIVERY   = 4,
    00027 };
    00028
    00030 enum IndustryAvailabilityCallType {
    00031   IACT_MAPGENERATION,
    00032   IACT_RANDOMCREATION,
    00033   IACT_USERCREATION,
    00034   IACT_PROSPECTCREATION,
    00035 };
    00036
    00037 /* in newgrf_industry.cpp */
    00038 uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available);
    00039 uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile);
    00040 uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i, uint32 cur_grfid);
    00041 void IndustryProductionCallback(Industry *ind, int reason);
    00042 CommandCost CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint layout, uint32 seed, uint16 initial_random_bits, Owner founder, IndustryAvailabilityCallType creation_type);
    00043 bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_type);
    00044 bool IndustryTemporarilyRefusesCargo(Industry *ind, CargoID cargo_type);
    00045
    00046 IndustryType MapNewGRFIndustryType(IndustryType grf_type, uint32 grf_id);
    00047
    00048 /* in newgrf_industrytiles.cpp*/
    00049 uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index, bool signed_offsets = true);
    00050
    00051 #endif /* NEWGRF_INDUSTRIES_H */