46 lines
No EOL
1.3 KiB
C#
46 lines
No EOL
1.3 KiB
C#
namespace BucketChain;
|
|
|
|
/// <summary>
|
|
/// Represents a bucket used to transport water.
|
|
/// </summary>
|
|
public sealed class Bucket
|
|
{
|
|
// TODO
|
|
|
|
/// <summary>
|
|
/// Creates a new bucket with the given capacity.
|
|
/// </summary>
|
|
/// <param name="capacityLiters">Bucket capacity in liters</param>
|
|
public Bucket(double capacityLiters)
|
|
{
|
|
// TODO
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets if this bucket is currently completely empty or not.
|
|
/// </summary>
|
|
public bool IsEmpty => false; // TODO
|
|
|
|
/// <summary>
|
|
/// Fills the bucket to the brim if enough water is available.
|
|
/// If there is not enough water to fill the bucket completely it takes as much as possible.
|
|
/// If the bucket is already full no water is taken.
|
|
/// </summary>
|
|
/// <param name="maxAvailable">Max. available water, in liters</param>
|
|
/// <returns>The amount taken for filling the bucket</returns>
|
|
public double Fill(double maxAvailable)
|
|
{
|
|
// TODO
|
|
return -1D;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Empties the bucket. The amount stored within before emptying is returned.
|
|
/// </summary>
|
|
/// <returns>Amount emptied from the bucket, in liters</returns>
|
|
public double Empty()
|
|
{
|
|
// TODO
|
|
return -1D;
|
|
}
|
|
} |