using System;
using SabreTools.Library.Data;
namespace SabreTools.Library.DatFiles
{
public class DepotInformation : ICloneable
{
///
/// Name or path of the Depot
///
public string Name { get; private set; }
///
/// Whether to use this Depot or not
///
public bool IsActive { get; private set; }
///
/// Depot byte-depth
///
public int Depth { get; private set; }
///
/// Constructor
///
/// Set active state
/// Set depth between 0 and SHA-1's byte length
public DepotInformation(bool isActive = false, int depth = 4)
{
IsActive = isActive;
Depth = depth;
// Limit depth value
if (Depth == Int32.MinValue)
Depth = 4;
else if (Depth < 0)
Depth = 0;
else if (Depth > Constants.SHA1Zero.Length)
Depth = Constants.SHA1Zero.Length;
}
#region Cloning
///
/// Clone the current object
///
public object Clone()
{
return new DepotInformation
{
Name = this.Name,
IsActive = this.IsActive,
Depth = this.Depth,
};
}
#endregion
}
}