From a6fa467deec581b1f0c1392e2658c7072c1a994d Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 22 Jun 2008 01:22:34 +0000 Subject: Let a level_id be directly compared to a branch type with == and != to determine if a level_id is (not) in BRANCH_FOO; takes care of comparing level_type to LEVEL_DUNGEON. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6034 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/travel.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crawl-ref/source/travel.h') diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index d657cbb21a..8f42f83cac 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -258,6 +258,17 @@ public: return (branch < id.branch) || (branch==id.branch && depth < id.depth); } + bool operator == ( const branch_type _branch ) const + { + return (branch == _branch && level_type == LEVEL_DUNGEON); + } + + bool operator != ( const branch_type _branch ) const + { + return !operator == (_branch); + } + + int absdepth() const; void save(writer&) const; -- cgit v1.2.3-54-g00ecf