diff options
author | Neil Moore <neil@s-z.org> | 2014-07-20 22:31:05 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-07-20 22:39:26 -0400 |
commit | 333664be5c07955e162e2bad790af781b60ad929 (patch) | |
tree | 7f2634c63f90a4a0bf000818eacded2807a8a90b /crawl-ref/source/mon-util.cc | |
parent | a692dc630d8867cd8f7096032f876bc1d15842ba (diff) | |
download | crawl-ref-333664be5c07955e162e2bad790af781b60ad929.tar.gz crawl-ref-333664be5c07955e162e2bad790af781b60ad929.zip |
Provide and use a public interface to pronoun declensions.
It's in mon-util.h for now but probably should go somewhere else.
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r-- | crawl-ref/source/mon-util.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index f26351c90b..eb46b1f61c 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3710,6 +3710,13 @@ static const char * const _pronoun_declension[][NUM_PRONOUN_CASES] = { "she", "her", "herself", "her" }, // feminine }; +const char *decline_pronoun(gender_type gender, pronoun_type variant) +{ + ASSERT_RANGE(gender, 0, NUM_GENDERS); + ASSERT_RANGE(variant, 0, NUM_PRONOUN_CASES); + return _pronoun_declension[gender][variant]; +} + // Use of variant (case is irrelevant here): // PRONOUN_SUBJECTIVE : _She_ is tap dancing. // PRONOUN_POSSESSIVE : _Its_ sword explodes! @@ -3721,7 +3728,7 @@ const char *mons_pronoun(monster_type mon_type, pronoun_type variant, COMPILE_CHECK(ARRAYSZ(_pronoun_declension) == NUM_GENDERS); const gender_type gender = !visible ? GENDER_NEUTER : _mons_class_gender(mon_type); - return _pronoun_declension[gender][variant]; + return decline_pronoun(gender, variant); } // Checks if the monster can use smiting/torment to attack without |