Looks better

This commit is contained in:
MarcUs7i 2024-12-17 20:35:57 +01:00
parent f2b5622562
commit db300f950c
2 changed files with 12 additions and 22 deletions

View file

@ -113,7 +113,6 @@ public sealed class Person
}
LastStepPerformed = currentStep;
RightNeighbor.LastStepPerformed = currentStep;
return true;
}
@ -127,6 +126,7 @@ public sealed class Person
var amount = _forwardBucket?.Empty();
fire.GetHitByWater(amount ?? 0);
_backwardBucket = _forwardBucket;
_forwardBucket = null;
}
/// <summary>
@ -145,7 +145,7 @@ public sealed class Person
well.FillBucket(_forwardBucket);
}
// else fill backward bucket if empty
else if (_backwardBucket is { IsEmpty: true })
else if (_forwardBucket == null && _backwardBucket is { IsEmpty: true })
{
well.FillBucket(_backwardBucket);
@ -157,26 +157,10 @@ public sealed class Person
}
}
// else add additional bucket
else if (additionalBucket != null)
else if (additionalBucket != null && _forwardBucket == null && _backwardBucket == null)
{
if (_forwardBucket == null)
{
_forwardBucket = additionalBucket;
}
else if (_backwardBucket == null)
{
_backwardBucket = additionalBucket;
}
// try to fill the new bucket
if (_forwardBucket is { IsEmpty: true })
{
well.FillBucket(_forwardBucket);
}
else if (_backwardBucket is { IsEmpty: true })
{
well.FillBucket(_backwardBucket);
}
_forwardBucket = additionalBucket;
well.FillBucket(_forwardBucket);
}
}