1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

made flags in hyper.h consistent with langen.cpp

This commit is contained in:
Zeno Rogue 2022-07-05 21:20:21 +02:00
parent 7fda3c08c4
commit c652b6bd00
2 changed files with 16 additions and 12 deletions

View File

@ -110,10 +110,11 @@ struct hr_shortest_path_exception { };
#define GEN_F 1
#define GEN_N 2
#define GEN_O 3
#define GEN_BASE_MASK 7
#define GENF_ELISION (4 << 0)
#define GENF_PLURALONLY (4 << 1)
#define GENF_PROPER (4 << 2)
#define GENF_ELISION (1 << 3)
#define GENF_PLURALONLY (1 << 4)
#define GENF_PROPER (1 << 5)
// Add a message to the GUI.
// If multiple messages appear with the same spamtype != 0, the older ones disappear quickly

View File

@ -96,23 +96,26 @@ template<class T> const T* findInHashTableS(string s, const T *table, int size)
#endif
string choose2(int g, string a, string b) {
if((g & 0b11) == GEN_M || (g & 0b11) == GEN_O) return a;
if((g & 0b11) == GEN_F || (g & 0b11) == GEN_N) return b;
g &= GEN_BASE_MASK;
if(g == GEN_M || g == GEN_O) return a;
if(g == GEN_F || g == GEN_N) return b;
return "?" + a;
}
string choose3(int g, string a, string b, string c) {
if((g & 0b11) == GEN_M || (g & 0b11) == GEN_O) return a;
if((g & 0b11) == GEN_F) return b;
if((g & 0b11) == GEN_N) return c;
g &= GEN_BASE_MASK;
if(g == GEN_M || g == GEN_O) return a;
if(g == GEN_F) return b;
if(g == GEN_N) return c;
return "?" + a;
}
string choose4(int g, string a, string b, string c, string d) {
if((g & 0b11) == GEN_M) return a;
if((g & 0b11) == GEN_F) return b;
if((g & 0b11) == GEN_N) return c;
if((g & 0b11) == GEN_O) return d;
g &= GEN_BASE_MASK;
if(g == GEN_M) return a;
if(g == GEN_F) return b;
if(g == GEN_N) return c;
if(g == GEN_O) return d;
return "?" + a;
}