Looks better
This commit is contained in:
parent
f2b5622562
commit
db300f950c
2 changed files with 12 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue