split the selection panel into one card per kind of selection
This commit is contained in:
31
src/ui/selection/BufferSection.h
Normal file
31
src/ui/selection/BufferSection.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
struct Building;
|
||||
class QLabel;
|
||||
|
||||
// The input and output buffer contents of one building (REQ-UI-SINGLE-SELECTION).
|
||||
//
|
||||
// Counting what is in the buffers is the same for every building type, so it happens
|
||||
// here; what a cycle consumes and produces is not, so the owning content supplies those
|
||||
// per-cycle amounts. An item with no entry in the maps is shown without a denominator.
|
||||
class BufferSection : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BufferSection(QWidget* parent = nullptr);
|
||||
|
||||
// perCycleInputs and perCycleOutputs map an item id to the amount one production
|
||||
// cycle consumes or produces. Both may be empty, for a building that runs no cycle.
|
||||
void setBuffers(const Building& building,
|
||||
const std::map<std::string, int>& perCycleInputs,
|
||||
const std::map<std::string, int>& perCycleOutputs);
|
||||
|
||||
private:
|
||||
QLabel* m_label;
|
||||
};
|
||||
Reference in New Issue
Block a user