mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Extend decklist parsing (#5316)
* Extend the decklist parsing from clipboard to also support SetName, CollectorNumber and Foil Status. * Q_UNUSED foil for now but keep parsing logic for future PR's/compatibility. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
cc16b8779c
commit
81b85e97df
11 changed files with 140 additions and 28 deletions
|
|
@ -352,14 +352,14 @@ public:
|
|||
* take a InnerDecklistNode* as its first argument and a
|
||||
* DecklistCardNode* as its second.
|
||||
*/
|
||||
template <typename Callback> void forEachCard(Callback &callback) const
|
||||
template <typename Callback> void forEachCard(Callback &callback)
|
||||
{
|
||||
// Support for this is only possible if the internal structure
|
||||
// doesn't get more complicated.
|
||||
for (int i = 0; i < root->size(); i++) {
|
||||
const InnerDecklistNode *node = dynamic_cast<InnerDecklistNode *>(root->at(i));
|
||||
InnerDecklistNode *node = dynamic_cast<InnerDecklistNode *>(root->at(i));
|
||||
for (int j = 0; j < node->size(); j++) {
|
||||
const DecklistCardNode *card = dynamic_cast<DecklistCardNode *>(node->at(j));
|
||||
DecklistCardNode *card = dynamic_cast<DecklistCardNode *>(node->at(j));
|
||||
callback(node, card);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue