summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/state.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-02 11:38:37 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-02 11:38:37 +0000
commit6b34259b6ce235196c3f2f70e706d9235dc100cb (patch)
tree3721090b7a2f55185e57286f368924a44a7525f7 /crawl-ref/source/state.h
parent4ff73ba59f0c4cd921620150ac3da663e467adee (diff)
downloadcrawl-ref-6b34259b6ce235196c3f2f70e706d9235dc100cb.tar.gz
crawl-ref-6b34259b6ce235196c3f2f70e706d9235dc100cb.zip
Replaced inc_god_acting/dec_god_acting pairing with god_acting objects.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2299 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/state.h')
-rw-r--r--crawl-ref/source/state.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/crawl-ref/source/state.h b/crawl-ref/source/state.h
index 8e5a9cc4b5..4b4952026a 100644
--- a/crawl-ref/source/state.h
+++ b/crawl-ref/source/state.h
@@ -107,6 +107,28 @@ public:
std::vector<god_act_state> other_gods_acting() const;
};
+
extern game_state crawl_state;
+class god_acting
+{
+public:
+ god_acting(bool is_retribution = false)
+ : god(you.religion)
+ {
+ crawl_state.inc_god_acting(god, is_retribution);
+ }
+ god_acting(god_type who, bool is_retribution = false)
+ : god(who)
+ {
+ crawl_state.inc_god_acting(god, is_retribution);
+ }
+ ~god_acting()
+ {
+ crawl_state.dec_god_acting(god);
+ }
+private:
+ god_type god;
+};
+
#endif