Update readme and changelog for v1.26.0
[openttd-joker.git] / src / zoning.h
blobf1b6d85909ea33f6c4e4e1bcd38e8aa803f98a55
2 /* $Id$ */
4 /*
5 * This file is part of OpenTTD.
6 * 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.
7 * 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.
8 * 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/>.
9 */
11 /** @file zoning.h */
13 #ifndef ZONING_H
14 #define ZONING_H
16 #include "tile_cmd.h"
17 #include "company_type.h"
19 /**
20 * Zoning evaluation modes
22 enum ZoningEvaluationMode {
23 ZEM_NOTHING = 0, ///< No zoning action selected
24 ZEM_AUTHORITY, ///< Check the local authority's opinion.
25 ZEM_CAN_BUILD, ///< Check wither or not the player can build.
26 ZEM_STA_CATCH, ///< Check catchment area for stations
27 ZEM_BUL_UNSER, ///< Check for unserved buildings
28 ZEM_IND_UNSER, ///< Check for unserved industries
29 ZEM_TRACERESTRICT, ///< Check for restricted signals
32 /**
33 * Zoning evaluation modes
35 enum ZoningModeMask {
36 ZMM_NOTHING = 0, ///< No zoning mask
37 ZMM_INNER, ///< Inner
38 ZMM_OUTER, ///< Outer
39 ZMM_ALL = ZMM_INNER | ZMM_OUTER,
41 DECLARE_ENUM_AS_BIT_SET(ZoningModeMask)
43 /**
44 * Global Zoning state structure
46 struct Zoning {
47 ZoningEvaluationMode inner;
48 ZoningEvaluationMode outer;
51 extern Zoning _zoning;
53 SpriteID TileZoningSpriteEvaluation(TileIndex tile, Owner owner, ZoningEvaluationMode ev_mode);
55 int TileZoningEvaluation(TileIndex tile, Owner owner, ZoningEvaluationMode ev_mode);
57 void DrawTileZoning(const TileInfo *ti);
59 void ShowZoningToolbar();
61 void ZoningMarkDirtyStationCoverageArea(const Station *st, ZoningModeMask mask = ZMM_ALL);
62 inline void ZoningMarkDirtyStationCoverageArea(const Waypoint *st) { } // no-op
64 void SetZoningMode(bool inner, ZoningEvaluationMode mode);
66 void ClearZoningCaches();
68 #endif /* ZONING_H */