servatrice/cockatrice/src/cardfilter.h
ctrlaltca 4eda7cda9e Make deck editor filter translatable ; extracted new translations; Fix #3488 (#3490)
* Fix #3488 ; extracted new translations

* Make operators translatable, too
2019-01-07 21:50:36 -05:00

64 lines
1 KiB
C++

#ifndef CARDFILTER_H
#define CARDFILTER_H
#include <QObject>
#include <QString>
class CardFilter : public QObject
{
Q_OBJECT
public:
enum Type
{
TypeAnd = 0,
TypeOr,
TypeAndNot,
TypeOrNot,
TypeEnd
};
/* if you add an atribute here you also need to
* add its string representation in attrName */
enum Attr
{
AttrCmc = 0,
AttrColor,
AttrLoyalty,
AttrManaCost,
AttrName,
AttrPow,
AttrRarity,
AttrSet,
AttrText,
AttrTough,
AttrType,
AttrEnd
};
private:
QString trm;
enum Type t;
enum Attr a;
public:
CardFilter(QString term, Type type, Attr attr) : trm(term), t(type), a(attr){};
Type type() const
{
return t;
}
const QString &term() const
{
return trm;
}
Attr attr() const
{
return a;
}
static const QString typeName(Type t);
static const QString attrName(Attr a);
};
#endif