Initial commit

This commit is contained in:
github-classroom[bot] 2024-11-17 08:52:38 +00:00 committed by GitHub
commit 593d8ebfea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 2206 additions and 0 deletions

46
BucketChain/Bucket.cs Normal file
View file

@ -0,0 +1,46 @@
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;
}
}