Index: Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs
===================================================================
diff -u -r396f21603d742cdfb0e92817e5fd0b4df1e9f851 -r3e3087bd9c43ca5a3910438b3c9daf0defcb09bf
--- Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs (.../StructureBase.cs) (revision 396f21603d742cdfb0e92817e5fd0b4df1e9f851)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/StructureBase.cs (.../StructureBase.cs) (revision 3e3087bd9c43ca5a3910438b3c9daf0defcb09bf)
@@ -33,35 +33,52 @@
///
/// Creates a new instance of .
///
- /// The name of the structure.
- /// The identifier of the structure.
- /// The location of the structure.
- /// The orientation of the structure, relative to north.
- /// Thrown when or is null
- /// , empty or consists of whitespace.
- /// Thrown when is null.
- protected StructureBase(string name, string id, Point2D location, double structureNormalOrientation)
+ /// The parameters required to construct a new
+ /// instance of .
+ /// Thrown when
+ /// or is null , empty or consists of whitespace.
+ /// Thrown when is null.
+ protected StructureBase(ConstructionProperties constructionProperties)
{
- if (string.IsNullOrWhiteSpace(name))
+ if (string.IsNullOrWhiteSpace(constructionProperties.Name))
{
- throw new ArgumentException("Parameter is null, empty or consists of whitespace.", "name");
+ throw new ArgumentException("Name is null, empty or consists of whitespace.", "constructionProperties");
}
- if (string.IsNullOrWhiteSpace(id))
+ if (string.IsNullOrWhiteSpace(constructionProperties.Id))
{
- throw new ArgumentException("Parameter is null, empty or consists of whitespace.", "id");
+ throw new ArgumentException("Id is null, empty or consists of whitespace.", "constructionProperties");
}
- if (location == null)
+ if (constructionProperties.Location == null)
{
- throw new ArgumentNullException("location");
+ throw new ArgumentNullException("constructionProperties", "Location is null.");
}
- Name = name;
- Id = id;
- Location = location;
- StructureNormalOrientation = new RoundedDouble(2, structureNormalOrientation);
+ Name = constructionProperties.Name;
+ Id = constructionProperties.Id;
+ Location = constructionProperties.Location;
+ StructureNormalOrientation = new RoundedDouble(2, constructionProperties.StructureNormalOrientation);
}
///
+ /// Creates a new instance of .
+ ///
+ /// The name of the structure.
+ /// The identifier of the structure.
+ /// The location of the structure.
+ /// The orientation of the structure, relative to north.
+ /// Thrown when or is null
+ /// , empty or consists of whitespace.
+ /// Thrown when is null.
+ protected StructureBase(string name, string id, Point2D location, double structureNormalOrientation) :
+ this(new ConstructionProperties
+ {
+ Name = name,
+ Id = id,
+ Location = location,
+ StructureNormalOrientation = (RoundedDouble) structureNormalOrientation
+ }) {}
+
+ ///
/// Gets the name of the structure.
///
public string Name { get; private set; }
@@ -85,5 +102,31 @@
{
return Name;
}
+
+ ///
+ /// Class holding the various construction parameters for .
+ ///
+ public class ConstructionProperties
+ {
+ ///
+ /// Gets the name of the structure.
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// Gets the identifier of the structure.
+ ///
+ public string Id { get; set; }
+
+ ///
+ /// Gets the location of the structure.
+ ///
+ public Point2D Location { get; set; }
+
+ ///
+ /// Gets the orientation of the closing structure, relative to north.
+ ///
+ public double StructureNormalOrientation { get; set; }
+ }
}
}
\ No newline at end of file