[Game] Refactor subtype tally code to be more generic

This commit is contained in:
RickyRister 2026-06-19 02:56:16 -07:00
parent 430fc117b4
commit e70011f4f9
8 changed files with 140 additions and 80 deletions

View file

@ -7,7 +7,7 @@
#ifndef GAMEVIEW_H
#define GAMEVIEW_H
#include "../game/selection_subtype_tally.h"
#include "tally/tally.h"
#include <QGraphicsView>
@ -24,13 +24,13 @@ private:
QRubberBand *rubberBand;
QLabel *dragCountLabel;
QLabel *totalCountLabel;
QWidget *subtypeTallyContainer;
QGridLayout *subtypeTallyLayout;
QWidget *tallyContainer;
QGridLayout *tallyLayout;
QPointF selectionOrigin;
QList<SubtypeEntry> cachedSubtypeEntries; ///< Cached entries to avoid redundant rebuilds
QList<TallyRow> cachedTallyRows; ///< Cached entries to avoid redundant rebuilds
QSize rebuildSubtypeLabels(const QList<SubtypeEntry> &entries);
void clearSubtypeLabels();
QSize rebuildTallyLabels(const QList<TallyRow> &entries);
void clearTallyLabels();
protected:
void resizeEvent(QResizeEvent *event) override;