Update cipt parsing (#5712)

* refactor

* move thing out

* write unit tests

* get thing to work

* optimization?

* fix build failure
This commit is contained in:
RickyRister
2025-03-14 18:44:13 -07:00
committed by GitHub
parent 068465143b
commit 3a11ccb854
7 changed files with 305 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
#include "oracleimporter.h"
#include "game/cards/card_database_parser/cockatrice_xml_4.h"
#include "parsehelpers.h"
#include "qt-json/json.h"
#include <QDebug>
@@ -157,9 +158,7 @@ CardInfoPtr OracleImporter::addCard(QString name,
// DETECT CARD POSITIONING INFO
// cards that enter the field tapped
QRegularExpression ciptRegex("( it|" + QRegularExpression::escape(name) +
") enters( the battlefield)? tapped(?! unless)");
bool cipt = ciptRegex.match(text).hasMatch();
bool cipt = parseCipt(name, text);
bool landscapeOrientation = properties.value("maintype").toString() == "Battle" ||
properties.value("layout").toString() == "split" ||