// Copyright (C) Stichting Deltares 2016. All rights reserved. // // This file is part of Ringtoets. // // Ringtoets is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System; using System.Collections.Generic; using Ringtoets.Revetment.Data; namespace Ringtoets.Revetment.IO { /// /// Class for constructing objects. /// public static class ExportableWaveConditionsFactory { /// /// Create a collection of . /// /// The name of the calculation to which the objects belong. /// The used in the calculations. /// The objects resulting from columns calculations. /// The objects resulting from blocks calculations. /// A container of objects. /// Thrown when any parameter is null or /// when is null for or . /// Thrown when /// is null for . public static IEnumerable CreateExportableWaveConditionsCollection( string name, WaveConditionsInput waveConditionsInput, IEnumerable columnsOutput, IEnumerable blocksOutput) { if (name == null) { throw new ArgumentNullException("name"); } if (waveConditionsInput == null) { throw new ArgumentNullException("waveConditionsInput"); } if (columnsOutput == null) { throw new ArgumentNullException("columnsOutput"); } if (blocksOutput == null) { throw new ArgumentNullException("blocksOutput"); } var exportableWaveConditionsCollection = new List(); foreach (WaveConditionsOutput waveConditionsOutput in columnsOutput) { exportableWaveConditionsCollection.Add(new ExportableWaveConditions(name, waveConditionsInput, waveConditionsOutput, CoverType.StoneCoverColumns)); } foreach (WaveConditionsOutput blocksConditionsOutput in blocksOutput) { exportableWaveConditionsCollection.Add(new ExportableWaveConditions(name, waveConditionsInput, blocksConditionsOutput, CoverType.StoneCoverBlocks)); } return exportableWaveConditionsCollection; } } }