diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-12-04 23:09:13 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-12-05 00:18:58 +0100 |
commit | 26615fd41b329d37a966b172d9fd61431b08c994 (patch) | |
tree | 0b14b1a93e1faf4dc4a360276726ca44c18ec4e8 /crawl-ref/source/delay.h | |
parent | 1dc9e5a843c5b1a9f10ed464e453e935dac6fc0e (diff) | |
download | crawl-ref-26615fd41b329d37a966b172d9fd61431b08c994.tar.gz crawl-ref-26615fd41b329d37a966b172d9fd61431b08c994.zip |
Change seen_context from strings to enums, slightly untangle it.
It's still a terrible mess. I didn't manage to understand it well enough
so all[1] functionality is preserved, at the cost of clarity. I unified
some values that are functionally identical, but not yet all.
[1]. The context is reported only as a number in crash dumps, a minor
regression but 1. saves speed, 2. it'd be a matter of copying the enum
names if someone actually needs this.
Diffstat (limited to 'crawl-ref/source/delay.h')
-rw-r--r-- | crawl-ref/source/delay.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/delay.h b/crawl-ref/source/delay.h index 8f0cacb266..adf2830ebb 100644 --- a/crawl-ref/source/delay.h +++ b/crawl-ref/source/delay.h @@ -24,30 +24,30 @@ struct activity_interrupt_data { activity_interrupt_payload_type apt; const void *data; - std::string context; + seen_context_type context; activity_interrupt_data() - : apt(AIP_NONE), data(NULL), context() + : apt(AIP_NONE), data(NULL), context(SC_NONE) { } activity_interrupt_data(const int *i) - : apt(AIP_INT), data(i), context() + : apt(AIP_INT), data(i), context(SC_NONE) { } activity_interrupt_data(const char *s) - : apt(AIP_STRING), data(s), context() + : apt(AIP_STRING), data(s), context(SC_NONE) { } activity_interrupt_data(const std::string &s) - : apt(AIP_STRING), data(s.c_str()), context() + : apt(AIP_STRING), data(s.c_str()), context(SC_NONE) { } - activity_interrupt_data(const monster* m, const std::string &ctx = "") + activity_interrupt_data(const monster* m, seen_context_type ctx = SC_NONE) : apt(AIP_MONSTER), data(m), context(ctx) { } activity_interrupt_data(const ait_hp_loss *ahl) - : apt(AIP_HP_LOSS), data(ahl), context() + : apt(AIP_HP_LOSS), data(ahl), context(SC_NONE) { } activity_interrupt_data(const activity_interrupt_data &a) |