예제 #1
0
    // Join Crossed Matches from same type
    public static MatchInfo JoinCrossedMatches(MatchInfo a, MatchInfo b)
    {
        if (!(a.isValid && b.isValid) || a.pivot.type != b.pivot.type)
        {
            return(new MatchInfo());
        }

        foreach (BaseGem match in a._matches)
        {
            if (b._matches.Contains(match))
            {
                a._pivot = match.position;
                b._matches.Remove(match);
                a.AddMatches(b._matches);

                return(a);
            }
        }

        return(new MatchInfo());
    }