mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
[VDE] Consolidate statistical analysis into a separate object (#6392)
* [VDE] Consolidate statistical analysis into a separate object so multiple widgets can re-use calculations and calculation is only performed once on data change. * [VDE] Lint. * [VDE] Move struct up to not confuse compiler. * [VDE] NoDiscards * [VDE] Move variables * [VDE] Lint.
This commit is contained in:
parent
364d0ca52b
commit
f0ebd28148
12 changed files with 215 additions and 202 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#define MANA_CURVE_WIDGET_H
|
||||
|
||||
#include "../general/display/banner_widget.h"
|
||||
#include "deck_list_statistics_analyzer.h"
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QWidget>
|
||||
|
|
@ -19,17 +20,14 @@ class ManaCurveWidget : public QWidget
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ManaCurveWidget(QWidget *parent, DeckListModel *deckListModel);
|
||||
explicit ManaCurveWidget(QWidget *parent, DeckListStatisticsAnalyzer *deckStatAnalyzer);
|
||||
void updateDisplay();
|
||||
|
||||
public slots:
|
||||
void setDeckModel(DeckListModel *deckModel);
|
||||
std::unordered_map<int, int> analyzeManaCurve();
|
||||
void retranslateUi();
|
||||
|
||||
private:
|
||||
DeckListModel *deckListModel;
|
||||
std::unordered_map<int, int> manaCurveMap;
|
||||
DeckListStatisticsAnalyzer *deckStatAnalyzer;
|
||||
QVBoxLayout *layout;
|
||||
BannerWidget *bannerWidget;
|
||||
QWidget *barContainer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue