/// <summary>Initializes a new instance of the <seealso cref="ZLayerInformation"/> struct.</summary> /// <param name="zLayer">The <seealso cref="ZLayer"/> whose information to retrieve.</param> public ZLayerInformation(ZLayer zLayer) { Position = GetZLayerPosition(zLayer); Layer = (zLayer - ZLayer.B1) / 2; if (Position == ZLayerPosition.Bottom) { Layer++; } }
/// <summary>Generates a <seealso cref="ZLayer"/> value from a <seealso cref="ZLayerPosition"/> and a layer on the relative position.</summary> /// <param name="position">The <seealso cref="ZLayerPosition"/>.</param> /// <param name="layer">The layer on the relative position.</param> public static ZLayer GenerateZLayer(ZLayerPosition position, int layer) { var result = (int)position * 2 * layer + ZLayer.B1; if (position == ZLayerPosition.Bottom) { result += 2; } return(result); }
/// <summary>Initializes a new instance of the <seealso cref="ZLayerInformation"/> struct.</summary> /// <param name="position">The relative position of the Z Layer (top or bottom).</param> /// <param name="layer">The layer.</param> public ZLayerInformation(ZLayerPosition position, int layer) { Position = position; Layer = layer; }