[Fix] Refactor project

This commit is contained in:
2026-03-02 12:49:12 +07:00
parent f65976796d
commit f52131f755
44 changed files with 449 additions and 404 deletions
@@ -17,7 +17,7 @@ namespace YachtDice.Modifiers.Pipeline
public int Compare(EffectEntry a, EffectEntry b)
{
int cmp = a.Effect.Phase.CompareTo(b.Effect.Phase);
var cmp = a.Effect.Phase.CompareTo(b.Effect.Phase);
if (cmp != 0) return cmp;
cmp = a.Effect.Priority.CompareTo(b.Effect.Priority);
@@ -56,14 +56,12 @@ namespace YachtDice.Modifiers.Pipeline
var activeSnapshot = _registry.Active;
// Gather eligible effects
for (int i = 0; i < activeSnapshot.Count; i++)
foreach (var inst in activeSnapshot)
{
var inst = activeSnapshot[i];
var behaviors = inst.Definition.Behaviors;
for (int b = 0; b < behaviors.Count; b++)
foreach (var behavior in behaviors)
{
var behavior = behaviors[b];
if (behavior == null) continue;
if (behavior.Trigger != trigger) continue;
@@ -45,9 +45,8 @@ namespace YachtDice.Modifiers.Pipeline
{
var sb = new StringBuilder();
sb.AppendLine($"[ModifierPipeline] Trigger: {Trigger}");
for (int i = 0; i < Entries.Count; i++)
foreach (var e in Entries)
{
var e = Entries[i];
if (e.EffectApplied != null)
{
sb.AppendLine($" EFFECT [{e.Phase}] {e.ModifierId} -> {e.EffectApplied}");