rename EntityId to BuildingId
This commit is contained in:
@@ -62,9 +62,9 @@ BlueprintPanel::BlueprintPanel(Simulation* sim, const GameConfig* config, QWidge
|
||||
connect(m_loadBtn, &QPushButton::clicked, this, &BlueprintPanel::onLoadClicked);
|
||||
}
|
||||
|
||||
void BlueprintPanel::onSelectionChanged(const std::vector<EntityId>& ids)
|
||||
void BlueprintPanel::onSelectionChanged(const std::vector<BuildingId>& ids)
|
||||
{
|
||||
m_selectedIds = ids;
|
||||
m_selectedBuildingIds = ids;
|
||||
refreshButtonStates();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void BlueprintPanel::clearActiveBlueprintButton()
|
||||
|
||||
void BlueprintPanel::onCreateClicked()
|
||||
{
|
||||
if (m_selectedIds.empty()) { return; }
|
||||
if (m_selectedBuildingIds.empty()) { return; }
|
||||
|
||||
Blueprint bp = createBlueprintFromSelection();
|
||||
if (bp.buildings.empty()) { return; }
|
||||
@@ -144,9 +144,9 @@ Blueprint BlueprintPanel::createBlueprintFromSelection() const
|
||||
const Building* building;
|
||||
};
|
||||
std::vector<Entry> entries;
|
||||
entries.reserve(m_selectedIds.size());
|
||||
entries.reserve(m_selectedBuildingIds.size());
|
||||
|
||||
for (const EntityId id : m_selectedIds)
|
||||
for (const BuildingId id : m_selectedBuildingIds)
|
||||
{
|
||||
const Building* b = m_sim->buildings().findBuilding(id);
|
||||
if (!b) { continue; }
|
||||
@@ -320,7 +320,7 @@ void BlueprintPanel::onLoadClicked()
|
||||
void BlueprintPanel::refreshButtonStates()
|
||||
{
|
||||
const bool anyPlaceable = [&]() {
|
||||
for (const EntityId id : m_selectedIds)
|
||||
for (const BuildingId id : m_selectedBuildingIds)
|
||||
{
|
||||
const Building* b = m_sim->buildings().findBuilding(id);
|
||||
if (!b) { continue; }
|
||||
|
||||
Reference in New Issue
Block a user