OpenTTD: src/depot_func.h Source File

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

depot_func.h
Go to the documentation of this file.
1 /* $Id: depot_func.h 23735 2012-01-03 20:26:05Z rubidium $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
9
12 #ifndef DEPOT_FUNC_H
13 #define DEPOT_FUNC_H
14
15 #include "vehicle_type.h"
16 #include "slope_func.h"
17
18 void ShowDepotWindow(TileIndex tile, VehicleType type);
19
20 void DeleteDepotHighlightOfVehicle(const Vehicle *v);
21
28 static inline bool CanBuildDepotByTileh(DiagDirection direction, Slope tileh)
29 {
30 assert(tileh != SLOPE_FLAT);
31 Slope entrance_corners = InclinedSlope(direction);
32 /* For steep slopes both entrance corners must be raised (i.e. neither of them is the lowest corner),
33 * For non-steep slopes at least one corner must be raised. */
34 return IsSteepSlope(tileh) ? (tileh & entrance_corners) == entrance_corners : (tileh & entrance_corners) != 0;
35 }
36
37 #endif /* DEPOT_FUNC_H */