summaryrefslogtreecommitdiff
path: root/src/tunnel_map.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-04-18 18:20:31 +0000
committerrubidium <rubidium@openttd.org>2007-04-18 18:20:31 +0000
commitaa284fd531a9beee460c6c04a51d3738c2e3a19e (patch)
treed3bb34af70e8e355de6b714c844d9402002c01e2 /src/tunnel_map.cpp
parent4eb87ac62ba75a39cf0f31fc0785681d028e8bc1 (diff)
downloadopenttd-aa284fd531a9beee460c6c04a51d3738c2e3a19e.tar.xz
(svn r9670) -Documentation: add documentation to some the _map files.
Diffstat (limited to 'src/tunnel_map.cpp')
-rw-r--r--src/tunnel_map.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tunnel_map.cpp b/src/tunnel_map.cpp
index db5cedaa9..d0788b951 100644
--- a/src/tunnel_map.cpp
+++ b/src/tunnel_map.cpp
@@ -7,6 +7,12 @@
#include "tile.h"
#include "tunnel_map.h"
+/**
+ * Gets the other end of the tunnel. Where a vehicle would reappear when it
+ * enters at the given tile.
+ * @param tile the tile to search from.
+ * @return the tile of the other end of the tunnel.
+ */
TileIndex GetOtherTunnelEnd(TileIndex tile)
{
DiagDirection dir = GetTunnelDirection(tile);
@@ -26,6 +32,13 @@ TileIndex GetOtherTunnelEnd(TileIndex tile)
}
+/**
+ * Is there a tunnel in the way in the given direction?
+ * @param tile the tile to search from.
+ * @param z the 'z' to search on.
+ * @param dir the direction to start searching to.
+ * @return true if and only if there is a tunnel.
+ */
static bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir)
{
TileIndexDiff delta = TileOffsByDiagDir(dir);
@@ -42,6 +55,12 @@ static bool IsTunnelInWayDir(TileIndex tile, uint z, DiagDirection dir)
GetTunnelDirection(tile) == dir;
}
+/**
+ * Is there a tunnel in the way in any direction?
+ * @param tile the tile to search from.
+ * @param z the 'z' to search on.
+ * @return true if and only if there is a tunnel.
+ */
bool IsTunnelInWay(TileIndex tile, uint z)
{
return