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

@ -11,6 +11,7 @@ public sealed class Chain
private readonly double _bucketSize;
private Person _firstPerson;
private int _availableBuckets;
private int _usedBuckets;
/// <summary>
/// Creates a new bucket chain based on the supplied parameters.
@ -56,7 +57,12 @@ public sealed class Chain
_fire.BurnHigher();
// step 3
var bucket = new Bucket(_bucketSize);
Bucket? bucket = null;
if (_usedBuckets < _availableBuckets)
{
bucket = new Bucket(_bucketSize);
_usedBuckets++;
}
_firstPerson.UseWell(_well, bucket);
// step 4