1 #ifndef GAME_SPECIFIC_TERMS_H
2 #define GAME_SPECIFIC_TERMS_H
3
4 #include <QCoreApplication>
5 #include <QString>
6
7 /*
8 * Collection of traslatable property names used in games,
9 * so we can use Game::Property instead of hardcoding strings.
10 * Note: Mtg = "Maybe that game"
11 */
12
13 namespace Mtg
14 {
15 QString const CardType("type");
16 QString const ConvertedManaCost("cmc");
17 QString const Colors("colors");
18 QString const Loyalty("loyalty");
19 QString const MainCardType("maintype");
20 QString const ManaCost("manacost");
21 QString const PowTough("pt");
22 QString const Side("side");
23 QString const Layout("layout");
24 QString const ColorIdentity("coloridentity");
25
getNicePropertyName(QString key)26 inline static const QString getNicePropertyName(QString key)
27 {
28 if (key == CardType)
29 return QCoreApplication::translate("Mtg", "Card Type");
30 if (key == ConvertedManaCost)
31 return QCoreApplication::translate("Mtg", "Converted Mana Cost");
32 if (key == Colors)
33 return QCoreApplication::translate("Mtg", "Color(s)");
34 if (key == Loyalty)
35 return QCoreApplication::translate("Mtg", "Loyalty");
36 if (key == MainCardType)
37 return QCoreApplication::translate("Mtg", "Main Card Type");
38 if (key == ManaCost)
39 return QCoreApplication::translate("Mtg", "Mana Cost");
40 if (key == PowTough)
41 return QCoreApplication::translate("Mtg", "P/T");
42 if (key == Side)
43 return QCoreApplication::translate("Mtg", "Side");
44 if (key == Layout)
45 return QCoreApplication::translate("Mtg", "Layout");
46 if (key == ColorIdentity)
47 return QCoreApplication::translate("Mtg", "Color Identity");
48 return key;
49 }
50 }; // namespace Mtg
51
52 #endif
53