Allow creating blueprints from construction sites
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Blueprint.h"
|
||||
#include "BuildingId.h"
|
||||
#include "BuildingType.h"
|
||||
#include "ItemType.h"
|
||||
@@ -38,3 +39,16 @@ struct BuildingConfig
|
||||
// by id, handling operational buildings and sites alike. Returns std::nullopt if
|
||||
// no such building or site exists.
|
||||
std::optional<BuildingConfig> readBuildingConfig(const Simulation& sim, BuildingId id);
|
||||
|
||||
// Captures a blueprint from a selection of building / construction-site ids, keeping
|
||||
// only player-placeable buildings and recording each one's type, rotation, offset
|
||||
// from the selection's bounding-box center, and configuration. Operational buildings
|
||||
// and construction sites are treated identically (REQ-UI-BLUEPRINT-CREATE,
|
||||
// REQ-UI-BLUEPRINT-STORAGE). The returned blueprint is unnamed.
|
||||
Blueprint captureBlueprintFromSelection(const Simulation& sim,
|
||||
const std::vector<BuildingId>& selectedIds);
|
||||
|
||||
// True if any selected id refers to a player-placeable building or construction site
|
||||
// (the enable condition for the Create Blueprint button, REQ-UI-BLUEPRINT-CREATE).
|
||||
bool selectionHasPlaceableBuilding(const Simulation& sim,
|
||||
const std::vector<BuildingId>& selectedIds);
|
||||
|
||||
Reference in New Issue
Block a user