public GlassAviary(GlassAviaryType glassAviaryType) : base() { _glassAviaryType = glassAviaryType; switch (glassAviaryType) { case GlassAviaryType.WithWater: _volume = 12.00; this.Capacity = 5; break; case GlassAviaryType.WithoutWater: _volume = 12.00; this.Capacity = 5; break; } }
public GlassAviary(GlassAviaryType glassAviaryType, double volume, byte capacity) : base() { try { if (volume <= 0 || capacity == 0) { throw new ArgumentException("Недопустимые значения объема и/или емкости!!!"); } _glassAviaryType = glassAviaryType; _volume = volume; this.Capacity = capacity; } catch (ArgumentException) { throw; } }