Beispiel #1
0
    protected UniLink GetLink(UniNode from, UniNode to, LinkType linkType)
    {
        if ((m_nodes == null) || (from == null) || (to == null))
        {
            return(null);
        }

        UniLink[] links = from.GetLinks(to, linkType);
        if ((links == null) || (links.Length == 0))
        {
            return(null);
        }

        return(links[0]);
    }
Beispiel #2
0
    protected UniLink GetLink(UniNode from, UniNode to, LinkType linkType, TLink linkValue)
    {
        if ((m_nodes == null) || (from == null) || (to == null))
        {
            return(null);
        }

        UniLink[] links = from.GetLinks(to, linkType);
        if ((links == null) || (links.Length == 0))
        {
            return(null);
        }

        for (int i = 0; i < links.Length; i++)
        {
            if (links[i].MatchesValue(linkValue))
            {
                return(links[i]);
            }
        }

        return(null);
    }