LibiadaCore.Core.CongenericChain.ClearAndSetNewLength C# (CSharp) Method

ClearAndSetNewLength() public method

Deletes chain (building and alphabet) and creates new empty chain with given length. Saves old element (alphabet) of chain.
/// Thrown if new length is less than 0. ///
public ClearAndSetNewLength ( int newLength ) : void
newLength int /// New chain length. ///
return void
        public override void ClearAndSetNewLength(int newLength)
        {
            if (newLength < 0)
            {
                throw new ArgumentException("Chain length shouldn't be less than 0.");
            }

            intervalsManager = null;
            length = newLength;
            positions = new List<int>();
        }