Skip to content

Commit 365f3a0

Browse files
committed
Implement ConditionCollection.IterateConditions()
1 parent 983d3e6 commit 365f3a0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/MHServerEmu.Games/Entities/ConditionCollection.cs

+17
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,23 @@ public ulong GetConditionIdByRef(PrototypeId conditionRef)
109109
return condition.Id;
110110
}
111111

112+
public IEnumerable<Condition> IterateConditions(bool skipDisabled)
113+
{
114+
if (skipDisabled)
115+
{
116+
foreach (Condition condition in _currentConditionDict.Values)
117+
{
118+
if (condition.IsEnabled)
119+
yield return condition;
120+
}
121+
}
122+
else
123+
{
124+
foreach (Condition condition in _currentConditionDict.Values)
125+
yield return condition;
126+
}
127+
}
128+
112129
public int GetNumberOfStacks(Condition condition)
113130
{
114131
throw new NotImplementedException();

0 commit comments

Comments
 (0)