split the selection panel into one card per kind of selection

This commit is contained in:
2026-08-07 18:38:55 +02:00
parent cc0ef856e3
commit 2289277e12
60 changed files with 3014 additions and 1559 deletions

View File

@@ -0,0 +1,34 @@
#pragma once
#include <vector>
#include "BuildingId.h"
#include "SelectionContent.h"
#include "SelectionContentFactory.h"
class QLabel;
// The count summary for several selected buildings that do not aggregate
// (REQ-UI-MULTI-SELECTION, REQ-UI-SELECTION-AGGREGATE): how many of each type, and the
// total building block cost of the selection. No per-building detail is shown.
class MultiBuildingContent : public SelectionContent
{
Q_OBJECT
public:
MultiBuildingContent(const SelectionContext& context,
const SelectionRequest& request, QWidget* parent = nullptr);
protected:
// The summary is fixed for a given selection -- how many of each type were selected,
// and what they cost -- so it is built once and has nothing to keep current. A
// building leaving the selection re-publishes it and rebuilds this card.
void refreshRuntime() override {}
private:
void buildSummary();
std::vector<BuildingId> m_ids;
QLabel* m_countsLabel;
QLabel* m_totalCostLabel;
};