Rename SubtypeCounter to SubtypeTally

This commit is contained in:
DawnFire42 2026-06-04 19:35:05 -04:00
parent c947808547
commit ca6cb8fb91
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
5 changed files with 16 additions and 16 deletions

View file

@ -82,7 +82,7 @@ set(cockatrice_SOURCES
src/game_graphics/game_scene.cpp
src/game/game_state.cpp
src/game_graphics/game_view.cpp
src/game/selection_subtype_counter.cpp
src/game/selection_subtype_tally.cpp
src/game_graphics/hand_counter.cpp
src/game_graphics/log/message_log_widget.cpp
src/game/phase.cpp

View file

@ -1,11 +1,11 @@
#include "selection_subtype_counter.h"
#include "selection_subtype_tally.h"
#include "board/card_item.h"
#include <QMap>
#include <algorithm>
namespace SelectionSubtypeCounter
namespace SelectionSubtypeTally
{
QStringList extractSubtypesFromFace(const QString &faceType)
@ -117,7 +117,7 @@ QString formatAsHtml(const QList<MainTypeGroup> &groups)
QStringLiteral("</span>");
}
QString buildSubtypeCountText(const QList<CardItem *> &cards)
QString buildSubtypeTallyText(const QList<CardItem *> &cards)
{
QList<MainTypeGroup> groups = countSubtypes(cards);
if (groups.isEmpty()) {
@ -126,4 +126,4 @@ QString buildSubtypeCountText(const QList<CardItem *> &cards)
return formatAsHtml(groups);
}
} // namespace SelectionSubtypeCounter
} // namespace SelectionSubtypeTally

View file

@ -1,5 +1,5 @@
#ifndef SELECTION_SUBTYPE_COUNTER_H
#define SELECTION_SUBTYPE_COUNTER_H
#ifndef SELECTION_SUBTYPE_TALLY_H
#define SELECTION_SUBTYPE_TALLY_H
#include <QList>
#include <QString>
@ -20,12 +20,12 @@ struct MainTypeGroup
QList<SubtypeEntry> subtypes;
};
namespace SelectionSubtypeCounter
namespace SelectionSubtypeTally
{
QStringList extractSubtypesFromFace(const QString &faceType);
QList<MainTypeGroup> countSubtypes(const QList<CardItem *> &cards);
QString formatAsHtml(const QList<MainTypeGroup> &groups);
QString buildSubtypeCountText(const QList<CardItem *> &cards);
} // namespace SelectionSubtypeCounter
QString buildSubtypeTallyText(const QList<CardItem *> &cards);
} // namespace SelectionSubtypeTally
#endif

View file

@ -2,7 +2,7 @@
#include "../client/settings/cache_settings.h"
#include "game_scene.h"
#include "selection_subtype_counter.h"
#include "selection_subtype_tally.h"
#include <QAction>
#include <QLabel>
@ -172,13 +172,13 @@ void GameView::refreshShortcuts()
SettingsCache::instance().shortcuts().getShortcut("Player/aCloseMostRecentZoneView"));
}
QString GameView::buildSubtypeCountText() const
QString GameView::buildSubtypeTallyText() const
{
GameScene *gameScene = dynamic_cast<GameScene *>(scene());
if (!gameScene) {
return QString();
}
return SelectionSubtypeCounter::buildSubtypeCountText(gameScene->selectedCards());
return SelectionSubtypeTally::buildSubtypeTallyText(gameScene->selectedCards());
}
void GameView::updateSelectionCount(const QSize &viewSize)
@ -208,7 +208,7 @@ void GameView::updateSelectionCount(const QSize &viewSize)
return;
}
QString subtypeText = buildSubtypeCountText();
QString subtypeText = buildSubtypeTallyText();
if (subtypeText.isEmpty()) {
subtypeCountLabel->hide();

View file

@ -24,8 +24,8 @@ private:
QLabel *subtypeCountLabel; ///< Label displaying subtype breakdown for selected cards
QPointF selectionOrigin;
/** @brief Builds formatted text showing subtype counts for all selected cards */
QString buildSubtypeCountText() const;
/** @brief Builds formatted text showing subtype tally for all selected cards */
QString buildSubtypeTallyText() const;
protected:
void resizeEvent(QResizeEvent *event) override;