diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-29 00:57:54 -0700 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-10-29 00:57:54 -0700 |
commit | e083e2c09aad37199affe880180f2eda90d213ac (patch) | |
tree | bfc040e0ca6789a5f15c95f67fb19a9ff9bb6a3f /crawl-ref/source/travel.h | |
parent | a94e957868e1fc5b62358573d39bc27b1d6d38ab (diff) | |
download | crawl-ref-e083e2c09aad37199affe880180f2eda90d213ac.tar.gz crawl-ref-e083e2c09aad37199affe880180f2eda90d213ac.zip |
level_pos: add methods current() and is_on()
Added to level_pos the static method current(), similar to
level_id::current(), and is_on(level_id lev), which returns true if the
level_pos is on the given level_id.
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r-- | crawl-ref/source/travel.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index 3dcf059577..dde4ce08fc 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -197,6 +197,9 @@ struct level_pos pos.x = pos.y = -1; } + // Returns the level_pos of where the player is standing. + static level_pos current(); + bool operator == ( const level_pos &lp ) const { return id == lp.id && pos == lp.pos; @@ -217,6 +220,11 @@ struct level_pos return id.depth > -1 && pos.x != -1 && pos.y != -1; } + bool is_on( const level_id _id) + { + return id == _id; + } + void clear() { id.clear(); |