Cockatrice 2026-06-01-Development-3.1.0-beta.3
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
game_specific_terms.h
Go to the documentation of this file.
1
6
7#ifndef GAME_SPECIFIC_TERMS_H
8#define GAME_SPECIFIC_TERMS_H
9
10#include <QCoreApplication>
11#include <QString>
12
13/*
14 * Collection of traslatable property names used in games,
15 * so we can use Game::Property instead of hardcoding strings.
16 * Note: Mtg = "Maybe that game"
17 */
18
19namespace Mtg
20{
21QString const CardType("type");
22QString const ConvertedManaCost("cmc");
23QString const Colors("colors");
24QString const Loyalty("loyalty");
25QString const MainCardType("maintype");
26QString const ManaCost("manacost");
27QString const PowTough("pt");
28QString const Side("side");
29QString const Layout("layout");
30QString const ColorIdentity("coloridentity");
31
32inline static const QString getNicePropertyName(QString key)
33{
34 if (key == CardType) {
35 return QCoreApplication::translate("Mtg", "Card Type");
36 }
37 if (key == ConvertedManaCost) {
38 return QCoreApplication::translate("Mtg", "Mana Value");
39 }
40 if (key == Colors) {
41 return QCoreApplication::translate("Mtg", "Color(s)");
42 }
43 if (key == Loyalty) {
44 return QCoreApplication::translate("Mtg", "Loyalty");
45 }
46 if (key == MainCardType) {
47 return QCoreApplication::translate("Mtg", "Main Card Type");
48 }
49 if (key == ManaCost) {
50 return QCoreApplication::translate("Mtg", "Mana Cost");
51 }
52 if (key == PowTough) {
53 return QCoreApplication::translate("Mtg", "P/T");
54 }
55 if (key == Side) {
56 return QCoreApplication::translate("Mtg", "Side");
57 }
58 if (key == Layout) {
59 return QCoreApplication::translate("Mtg", "Layout");
60 }
61 if (key == ColorIdentity) {
62 return QCoreApplication::translate("Mtg", "Color Identity");
63 }
64 return key;
65}
66} // namespace Mtg
67
68#endif
Definition game_specific_terms.h:20
static const QString getNicePropertyName(QString key)
Definition game_specific_terms.h:32
QString const ConvertedManaCost("cmc")
QString const PowTough("pt")
QString const CardType("type")
QString const Side("side")
QString const Colors("colors")
QString const Layout("layout")
QString const ManaCost("manacost")
QString const MainCardType("maintype")
QString const ColorIdentity("coloridentity")
QString const Loyalty("loyalty")