mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Refactor function structs into lambdas (#5675)
* change signature to use lambda * reuse comparator * inline structs in forEachCard * inline structs * Refactor exportDeckToDecklist * fix unit test
This commit is contained in:
parent
1d259a86c1
commit
26dcb015ce
9 changed files with 108 additions and 213 deletions
|
|
@ -5,25 +5,20 @@
|
|||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
// using std types because qt types aren't understood by gtest (without this you'll get less nice errors)
|
||||
using CardRows = QVector<std::pair<std::string, int>>;
|
||||
|
||||
struct Result
|
||||
{
|
||||
// using std types because qt types aren't understood by gtest (without this you'll get less nice errors)
|
||||
using CardRows = QVector<std::pair<std::string, int>>;
|
||||
std::string name;
|
||||
std::string comments;
|
||||
CardRows mainboard;
|
||||
CardRows sideboard;
|
||||
|
||||
Result()
|
||||
{
|
||||
}
|
||||
|
||||
Result(std::string _name, std::string _comments, CardRows _mainboard, CardRows _sideboard)
|
||||
: name(_name), comments(_comments), mainboard(_mainboard), sideboard(_sideboard)
|
||||
{
|
||||
}
|
||||
|
||||
void operator()(const InnerDecklistNode *innerDecklistNode, const DecklistCardNode *card);
|
||||
};
|
||||
|
||||
void testEmpty(const QString &clipboard);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue