14#include "../../BlueprintEditor/ConditionRef.h"
43 std::vector<PinSpec>
needed;
59 std::ostringstream
oss;
61 ?
cref.leftOperand.variableName
64 :
cref.leftOperand.constValue))
67 ?
cref.rightOperand.variableName
70 :
cref.rightOperand.constValue))
80 if (
preset->NeedsLeftPin())
83 if (
preset->NeedsRightPin())
88 std::vector<DynamicDataPin>
newPins;
93 DynamicDataPin*
existing = FindExistingPin(
spec.conditionIndex,
spec.position);
102 std::string
side = (
spec.position == OperandPosition::Left) ?
"L" :
"R";
103 std::ostringstream
oss;
105 <<
": " <<
spec.condPreview;
110 pin = DynamicDataPin(
spec.conditionIndex,
spec.position,
122 for (
size_t idx = 0;
idx < m_pins.size(); ++
idx)
124 DynamicDataPin&
p = m_pins[
idx];
126 p.sequenceNumber =
static_cast<int>(
idx) + 1;
127 m_idIndex[
p.id] =
idx;
128 m_keyIndex[MakePinKey(
p.conditionIndex,
p.position)] =
idx;
132 for (
auto&
ref : conditionRefs)
138 for (
const auto&
pin : m_pins)
140 int ci =
pin.conditionIndex;
144 if (
pin.position == OperandPosition::Left)
145 conditionRefs[
ci].leftPinID =
pin.id;
147 conditionRefs[
ci].rightPinID =
pin.id;
155void DynamicDataPinManager::RegeneratePinsFromConditions(
156 std::vector<NodeConditionRef>& conditionRefs,
169const std::vector<DynamicDataPin>& DynamicDataPinManager::GetAllPins()
const
176 auto it = m_idIndex.find(
pinID);
177 if (
it == m_idIndex.end())
179 return &m_pins[
it->second];
184 auto it = m_idIndex.find(
pinID);
185 if (
it == m_idIndex.end())
187 return &m_pins[
it->second];
190std::vector<const DynamicDataPin*>
191DynamicDataPinManager::GetPinsForCondition(
int conditionIndex)
const
193 std::vector<const DynamicDataPin*> result;
194 for (
const auto&
pin : m_pins)
196 if (
pin.conditionIndex == conditionIndex)
197 result.push_back(&
pin);
202size_t DynamicDataPinManager::GetPinCount()
const
204 return m_pins.size();
235void DynamicDataPinManager::Clear()
247void DynamicDataPinManager::GetDynamicPinColor(
float&
r,
float&
g,
263 auto it = m_keyIndex.find(MakePinKey(conditionIndex,
pos));
264 if (
it == m_keyIndex.end())
266 return &m_pins[
it->second];
270std::string DynamicDataPinManager::MakePinKey(
int conditionIndex,
273 std::ostringstream
oss;
274 oss << conditionIndex <<
'_'
275 << ((
pos == OperandPosition::Left) ?
'L' :
'R');
Engine for generating and tracking dynamic data pins (Phase 24.3).
ComponentTypeID GetComponentTypeID_Static()
Manages the global pool of ConditionPreset objects.
ConditionPreset * GetPreset(const std::string &id)
Returns a mutable pointer to the preset, or nullptr if not found.
DynamicDataPinManager(ConditionPresetRegistry ®istry)
Constructs the manager bound to the global preset registry.
ConditionPresetRegistry & m_registry
Shared global registry.
void SyncPins(std::vector< NodeConditionRef > &conditionRefs, const std::vector< ConditionRef > &operandRefs=std::vector< ConditionRef >())
Rebuilds the pin set to match the given condition list.
< Provides AssetID and INVALID_ASSET_ID
OperandPosition
Identifies which operand side a DynamicDataPin serves.
@ Right
Pin provides data for the right operand of the condition.
@ Left
Pin provides data for the left operand of the condition.
A globally-stored, reusable condition expression.
Stores the complete reference for one condition including operand-to-DynamicDataPin mapping.
std::string operatorStr
Comparison operator: "==", "<=", ">=", "!=", "<", ">".
A data-input pin created dynamically for a Pin-mode operand.
One entry in a NodeBranch's conditions list.
@ Variable
References a blackboard variable by name.
@ Pin
External data-input pin on the owning node.