mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
7960db35f2
# Conflicts: # config.lib # projects/openttd_vs140.vcxproj # projects/openttd_vs140.vcxproj.filters # projects/openttd_vs141.vcxproj # projects/openttd_vs141.vcxproj.filters # projects/openttd_vs142.vcxproj # projects/openttd_vs142.vcxproj.filters # src/aircraft_cmd.cpp # src/base_station_base.h # src/core/pool_type.hpp # src/disaster_vehicle.cpp # src/economy.cpp # src/engine.cpp # src/group.h # src/group_cmd.cpp # src/group_gui.cpp # src/lang/english.txt # src/lang/german.txt # src/linkgraph/linkgraph_gui.cpp # src/network/network_command.cpp # src/network/network_server.cpp # src/openttd.cpp # src/order_cmd.cpp # src/road_cmd.cpp # src/saveload/afterload.cpp # src/saveload/cargopacket_sl.cpp # src/saveload/linkgraph_sl.cpp # src/saveload/order_sl.cpp # src/saveload/station_sl.cpp # src/saveload/town_sl.cpp # src/saveload/vehicle_sl.cpp # src/screenshot.cpp # src/screenshot.h # src/settings_gui.cpp # src/settings_type.h # src/smallmap_gui.cpp # src/station.cpp # src/station_cmd.cpp # src/table/settings.ini # src/toolbar_gui.cpp # src/town_cmd.cpp # src/train.h # src/train_cmd.cpp # src/train_gui.cpp # src/vehicle.cpp # src/vehicle_base.h # src/vehiclelist.cpp # src/window_type.h
47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
/*
|
|
* This file is part of OpenTTD.
|
|
* 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.
|
|
* 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.
|
|
* 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/>.
|
|
*/
|
|
|
|
/** @file tunnel_base.h Base for all tunnels */
|
|
|
|
#ifndef TUNNEL_BASE_H
|
|
#define TUNNEL_BASE_H
|
|
|
|
#include "tunnel_map.h"
|
|
#include "core/pool_type.hpp"
|
|
|
|
struct Tunnel;
|
|
|
|
typedef Pool<Tunnel, TunnelID, 64, 1048576> TunnelPool;
|
|
extern TunnelPool _tunnel_pool;
|
|
|
|
struct Tunnel : TunnelPool::PoolItem<&_tunnel_pool> {
|
|
|
|
TileIndex tile_n; // North tile of tunnel.
|
|
TileIndex tile_s; // South tile of tunnel.
|
|
uint8 height; // Tunnel height
|
|
bool is_chunnel; // Whether this tunnel is a chunnel
|
|
|
|
Tunnel() {}
|
|
~Tunnel();
|
|
|
|
Tunnel(TileIndex tile_n, TileIndex tile_s, uint8 height, bool is_chunnel) : tile_n(tile_n), tile_s(tile_s), height(height), is_chunnel(is_chunnel)
|
|
{
|
|
this->UpdateIndexes();
|
|
}
|
|
|
|
void UpdateIndexes();
|
|
|
|
static inline Tunnel *GetByTile(TileIndex tile)
|
|
{
|
|
return Tunnel::Get(GetTunnelIndex(tile));
|
|
}
|
|
|
|
static void PreCleanPool();
|
|
};
|
|
|
|
#endif /* TUNNEL_BASE_H */
|