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

GetOccurrence() public method

Returns position of given occurrence of element of this chain. If occurrence not found returns -1.
public GetOccurrence ( int occurrence ) : int
occurrence int /// Occurrence to find. ///
return int
        public int GetOccurrence(int occurrence)
        {
            if (occurrence - 1 >= positions.Count)
            {
                return -1;
            }

            return positions[occurrence - 1];
        }