mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-26 10:29:34 -05:00
* CardDB: merge all card properties in a new structure * Pre Json parser changes * Cockatrice: use qt's builtin json support * Move qt-json src dir from cockatrice to oracle * Add dummy cockatricexml4 parser (yet to be implemented) * Implement a new parser and xml format * cockatricexml4: new xml parser following the "generic properties hash" pattern; * oracleimporter: refactor the parsing code to better adapt to cockatricexml4; rewrote split cards parsing * carddb: change "colors" from a stringlist to a string * carddb: move the getMainCardType() method to the cockatricexml3 parser * * CardInfo: show all properties (stil missing: nice name + translation) * Rework the "add related card" feature so that it doesn't change the card name in the carddb Also, fix token count display * Picture loader: Added support for transform cards * Fix side information for flip cards Mtgjson uses side a/b for flip cards, while scryfall doesn't * Pictureloader: dynamic tag resolution from card properties Examples old => new * !cardid! => !set:muid! * !uuid! => !set:uuid! * !collectornumber! => !set:num! New examples: * !prop:type! * !prop:manacost! * Start moving mtg-related property names to a specific file * Clangify * Fix tests * Make gcc an happy puppy * Revert "Make gcc an happy puppy" This reverts commit 446ec5f27516c4d3b32dbfc79557f4827c5c5bdf. * Some gcc fixes * Share set list between different db parsers, so they won't overwrite one each other * All glory to the hypnoclangifier! * Fix test compilation * Cleanup edited files in the prior PR. (#3519) * Cleanup edited files in the prior PR. Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com> * Fix includes Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com> * Update carddatabase.h
49 lines
1.5 KiB
C++
49 lines
1.5 KiB
C++
#ifndef GAME_SPECIFIC_TERMS_H
|
|
#define GAME_SPECIFIC_TERMS_H
|
|
|
|
#include <QCoreApplication>
|
|
#include <QString>
|
|
|
|
/*
|
|
* Collection of traslatable property names used in games,
|
|
* so we can use Game::Property instead of hardcoding strings.
|
|
* Note: Mtg = "Maybe that game"
|
|
*/
|
|
|
|
namespace Mtg
|
|
{
|
|
QString const CardType("type");
|
|
QString const ConvertedManaCost("cmc");
|
|
QString const Colors("colors");
|
|
QString const Loyalty("loyalty");
|
|
QString const MainCardType("maintype");
|
|
QString const ManaCost("manacost");
|
|
QString const PowTough("pt");
|
|
QString const Side("side");
|
|
QString const Layout("layout");
|
|
|
|
inline static const QString getNicePropertyName(QString key)
|
|
{
|
|
if (key == CardType)
|
|
return QCoreApplication::translate("Mtg", "Card type");
|
|
if (key == ConvertedManaCost)
|
|
return QCoreApplication::translate("Mtg", "Converted mana cost");
|
|
if (key == Colors)
|
|
return QCoreApplication::translate("Mtg", "Color(s)");
|
|
if (key == Loyalty)
|
|
return QCoreApplication::translate("Mtg", "Loyalty");
|
|
if (key == MainCardType)
|
|
return QCoreApplication::translate("Mtg", "Main card type");
|
|
if (key == ManaCost)
|
|
return QCoreApplication::translate("Mtg", "Mana cost");
|
|
if (key == PowTough)
|
|
return QCoreApplication::translate("Mtg", "P / T");
|
|
if (key == Side)
|
|
return QCoreApplication::translate("Mtg", "Side");
|
|
if (key == Layout)
|
|
return QCoreApplication::translate("Mtg", "Layout");
|
|
return key;
|
|
}
|
|
}; // namespace Mtg
|
|
|
|
#endif |