annotate src/newgrf_industries.h @ 8213:87c85bb42d6f draft

(svn r11776) -Codechange: more header splittings to reduce the dependencies.
author rubidium <rubidium@openttd.org>
date Mon, 07 Jan 2008 14:02:26 +0000
parents 4ea844b3d9f5
children 7fdca00c1151
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6835
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
1 /* $Id$ */
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
2
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
3 /** @file newgrf_industries.h */
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
4
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
5 #ifndef NEWGRF_INDUSTRIES_H
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
6 #define NEWGRF_INDUSTRIES_H
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
7
8213
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
8 #include "industry_type.h"
6835
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
9 #include "newgrf_spritegroup.h"
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
10
7621
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
11 /** When should the industry(tile) be triggered for random bits? */
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
12 enum IndustryTrigger {
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
13 /** Triggered each tile loop */
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
14 INDUSTRY_TRIGGER_TILELOOP_PROCESS = 1,
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
15 /** Triggered (whole industry) each 256 ticks */
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
16 INDUSTRY_TRIGGER_256_TICKS = 2,
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
17 /** Triggered on cargo delivery */
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
18 INDUSTRY_TRIGGER_CARGO_DELIVERY = 4,
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
19 };
61a0e1c69855 (svn r11151) -Codechange: add (partial) support for randomizing industry triggers (part of the backend for it). Furthermore update the documentation of the map's bits wrt to industries.
rubidium <rubidium@openttd.org>
parents: 7327
diff changeset
20
8213
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
21 /** From where is callback CBID_INDUSTRY_AVAILABLE been called */
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
22 enum IndustryAvailabilityCallType {
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
23 IACT_MAPGENERATION, ///< during random map generation
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
24 IACT_RANDOMCREATION, ///< during creation of random ingame industry
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
25 IACT_USERCREATION, ///< from the Fund/build window
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
26 };
87c85bb42d6f (svn r11776) -Codechange: more header splittings to reduce the dependencies.
rubidium <rubidium@openttd.org>
parents: 7622
diff changeset
27
6884
a5528f6005e9 (svn r10127) -Add: Addition of basic structure for industry tiles callbacks (unfinished).
belugas <belugas@openttd.org>
parents: 6868
diff changeset
28 /* in newgrf_industry.cpp */
6835
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
29 uint32 IndustryGetVariable(const ResolverObject *object, byte variable, byte parameter, bool *available);
7327
0ab2820a1e52 (svn r10690) -Codechange: use the enum that describes all callback IDs in favor of "just" using an untyped integer.
rubidium <rubidium@openttd.org>
parents: 7260
diff changeset
30 uint16 GetIndustryCallback(CallbackID callback, uint32 param1, uint32 param2, Industry *industry, IndustryType type, TileIndex tile);
7622
4ea844b3d9f5 (svn r11152) -Fix: GetIndustryIDAtOffset crashed when translation of the GFX ID would be needed. Fix by Belugas.
rubidium <rubidium@openttd.org>
parents: 7621
diff changeset
31 uint32 GetIndustryIDAtOffset(TileIndex new_tile, const Industry *i);
7168
f0216e74951d (svn r10442) -Codechange: implement the industry production callback.
rubidium <rubidium@openttd.org>
parents: 7102
diff changeset
32 void IndustryProductionCallback(Industry *ind, int reason);
7207
499c8197f5ed (svn r10485) -Codechange: add a callback mechanism to determine whether building an industry is allowed at a given location.
rubidium <rubidium@openttd.org>
parents: 7168
diff changeset
33 bool CheckIfCallBackAllowsCreation(TileIndex tile, IndustryType type, uint itspec_index);
7260
270b3009c7d3 (svn r10572) -Codechange: Add function CheckIfCallBackAllowsAvailability for industries
belugas <belugas@openttd.org>
parents: 7234
diff changeset
34 bool CheckIfCallBackAllowsAvailability(IndustryType type, IndustryAvailabilityCallType creation_type);
6835
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
35
7233
2c4001c66b86 (svn r10514) -Codechange: add support for getting the nearest industry with a given type.
rubidium <rubidium@openttd.org>
parents: 7207
diff changeset
36 IndustryType MapNewGRFIndustryType(IndustryType grf_type, uint32 grf_id);
2c4001c66b86 (svn r10514) -Codechange: add support for getting the nearest industry with a given type.
rubidium <rubidium@openttd.org>
parents: 7207
diff changeset
37
6884
a5528f6005e9 (svn r10127) -Add: Addition of basic structure for industry tiles callbacks (unfinished).
belugas <belugas@openttd.org>
parents: 6868
diff changeset
38 /* in newgrf_industrytiles.cpp*/
7234
7d1c55a8db8f (svn r10515) -Codechange: allow getting some more data about the environment of an industry.
rubidium <rubidium@openttd.org>
parents: 7233
diff changeset
39 uint32 GetNearbyIndustryTileInformation(byte parameter, TileIndex tile, IndustryID index);
7d1c55a8db8f (svn r10515) -Codechange: allow getting some more data about the environment of an industry.
rubidium <rubidium@openttd.org>
parents: 7233
diff changeset
40
6835
802a065d3d21 (svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
belugas <belugas@openttd.org>
parents:
diff changeset
41 #endif /* NEWGRF_INDUSTRIES_H */