15 lines
470 B
C#
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)}.");
|
|
}
|
|
}
|
|
}
|
|
} |