diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-01 16:07:21 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-01 16:07:21 +0000 |
commit | fc78d02aee0c39be4fb45b3b640a17f2af18cd45 (patch) | |
tree | 8826cfb101f01e3a0d2abe855e8dff8ef2ffc87c /crawl-ref/source/mapdef.h | |
parent | 0645520057d5b630626c5e6ce7bf3099c9500ea1 (diff) | |
download | crawl-ref-fc78d02aee0c39be4fb45b3b640a17f2af18cd45.tar.gz crawl-ref-fc78d02aee0c39be4fb45b3b640a17f2af18cd45.zip |
Added NSUBST.
Should not highlight unvisited stairs in the Vestibule, since travel cache
doesn't track visited-ness of Vestibule stairs.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1706 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.h')
-rw-r--r-- | crawl-ref/source/mapdef.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h index d761668f3d..4cc77e0af9 100644 --- a/crawl-ref/source/mapdef.h +++ b/crawl-ref/source/mapdef.h @@ -79,6 +79,7 @@ public: { TT_SHUFFLE, TT_SUBST, + TT_NSUBST, TT_MARKER }; @@ -94,6 +95,7 @@ class subst_spec : public map_transformer { public: subst_spec(int torepl, bool fix, const glyph_replacements_t &repls); + subst_spec() : foo(0), fix(false), frozen_value(0), repl() { } int key() const { @@ -117,6 +119,21 @@ private: glyph_replacements_t repl; }; +class nsubst_spec : public map_transformer +{ +public: + nsubst_spec(int key, const std::vector<subst_spec> &specs); + std::string apply_transform(map_lines &map); + map_transformer *clone() const; + transform_type type() const { return TT_NSUBST; } + std::string describe() const; + +public: + int key; + std::vector<subst_spec> specs; +}; + + struct shuffle_spec : public map_transformer { std::string shuffle; @@ -159,12 +176,14 @@ public: map_lines &operator = (const map_lines &); void add_line(const std::string &s); + std::string add_nsubst(const std::string &st); std::string add_subst(const std::string &st); std::string add_shuffle(const std::string &s); void remove_shuffle(const std::string &s); void remove_subst(const std::string &s); void clear_shuffles(); void clear_substs(); + void clear_nsubsts(); void clear_markers(); std::vector<coord_def> find_glyph(int glyph) const; @@ -218,6 +237,7 @@ private: void resolve_shuffle(const std::string &shuffle); void subst(std::string &s, subst_spec &spec); void subst(subst_spec &); + void nsubst(nsubst_spec &); void check_borders(); void clear_transforms(map_transformer::transform_type); std::string shuffle(std::string s); @@ -225,10 +245,16 @@ private: std::string check_shuffle(std::string &s); std::string check_block_shuffle(const std::string &s); std::string clean_shuffle(std::string s); + std::string parse_nsubst_spec(const std::string &s, + subst_spec &spec); + int apply_nsubst(std::vector<coord_def> &pos, + int start, int nsub, + subst_spec &spec); std::string parse_glyph_replacements(std::string s, glyph_replacements_t &gly); friend class subst_spec; + friend class nsubst_spec; friend class shuffle_spec; private: |