summaryrefslogtreecommitdiff
path: root/src/waypoint_base.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-12 18:31:39 +0000
committerrubidium <rubidium@openttd.org>2010-05-12 18:31:39 +0000
commit863ff6522b671ce69a1265fe246149b25e83a847 (patch)
treedea696bc261a69f8c6b499d8111a9f1c3c1680d6 /src/waypoint_base.h
parent0d9281dde3ca4001a2e25ea0f2945ca4ebdab9f9 (diff)
downloadopenttd-863ff6522b671ce69a1265fe246149b25e83a847.tar.xz
(svn r19798) -Codechange: generalise the waypoint naming method
Diffstat (limited to 'src/waypoint_base.h')
-rw-r--r--src/waypoint_base.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/waypoint_base.h b/src/waypoint_base.h
index 3f8a48db9..7dc7a5753 100644
--- a/src/waypoint_base.h
+++ b/src/waypoint_base.h
@@ -49,6 +49,17 @@ struct Waypoint : SpecializedStation<Waypoint, true> {
{
return (this->facilities & FACIL_TRAIN) != 0 && this->train_station.w == 1 && this->train_station.h == 1;
}
+
+ /**
+ * Is the "type" of waypoint the same as the given waypoint,
+ * i.e. are both a rail waypoint or are both a buoy?
+ * @param wp The waypoint to compare to.
+ * @return true iff their types are equal.
+ */
+ FORCEINLINE bool IsOfType(const Waypoint *wp) const
+ {
+ return this->string_id == wp->string_id;
+ }
};
#define FOR_ALL_WAYPOINTS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Waypoint, var)