Files
Bucket/Buckets.Logic/Rainbarrel.cs
KäseToatz a33cf50a4c Part 1 & 2
2024-09-25 22:24:42 +02:00

15 lines
470 B
C#

namespace Buckets.Logic
{
public class Rainbarrel : Container
{
private readonly int[] ALLOWED_CAPACITIES = [80, 100, 120];
public Rainbarrel(int capacity, int content) : base(capacity, content)
{
if (!ALLOWED_CAPACITIES.Contains(capacity))
{
throw new ArgumentException($"Capacity must be one of the following values: {string.Join(", ", ALLOWED_CAPACITIES)}.");
}
}
}
}