Exemple #1
0
        /// <summary>
        /// Sets the cancellations for the given Challenge.
        /// </summary>
        private static void RegisterCancellations(Type challengeType, BMChallengeInfo challengeInfo)
        {
            UnlockWrapper    unlock        = challengeInfo.UnlockBuilder.Unlock;
            HashSet <string> cancellations = new HashSet <string>();

            // cancel all Challenges in this conflictGroup
            if (challengeInfo.ConflictGroups.Count > 0)
            {
                foreach (string cancelChallenge in challengeInfo.ConflictGroups
                         .SelectMany(group => conflictGroupDict[group])
                         .Where(type => type != challengeType)                        // prevent Challenge from cancelling itself
                         .Select(GetChallengeInfo)
                         .Where(info => info != null)
                         .Select(info => info.Name))
                {
                    cancellations.Add(cancelChallenge);
                }
            }

            // TODO conflicts with vanilla Challenges

            unlock.SetCancellations(cancellations);
        }
Exemple #2
0
 /// <summary>
 ///   <para>Initializes a new instance of the <see cref="UnlockBuilder"/> class with the specified <paramref name="unlock"/>.</para>
 /// </summary>
 /// <param name="unlock">The unlock wrapper to use.</param>
 public UnlockBuilder(UnlockWrapper unlock) => Unlock = unlock;