Exemplo n.º 1
0
        /// <summary>Applies modifier to competition options.</summary>
        /// <param name="optionsModifier">Competition options to apply.</param>
        public void ApplyModifier([NotNull] CompetitionOptions optionsModifier)
        {
            Code.NotNull(optionsModifier, nameof(optionsModifier));

            var options = _options;

            string id = null;

            if (options.HasValue(CharacteristicObject.IdCharacteristic))
            {
                id = options.Id;
            }
            if (optionsModifier.HasValue(CharacteristicObject.IdCharacteristic))
            {
                id += optionsModifier.Id;
            }

            // DONTTOUCH: please DO NOT remove .Freeze() call.
            _options = new CompetitionOptions(id, options, optionsModifier).Freeze();
        }
Exemplo n.º 2
0
 /// <summary>Applies the specified competition options.</summary>
 /// <param name="config">The config.</param>
 /// <param name="optionsModifier">Competition options to apply.</param>
 /// <returns>Config with applied competition options.</returns>
 public static ICompetitionConfig WithModifier(
     this ICompetitionConfig config, CompetitionOptions optionsModifier) =>
 config.With(m => m.ApplyModifier(optionsModifier));
Exemplo n.º 3
0
 /// <summary>Sets the specified competition options.</summary>
 /// <param name="competitionOptions">Competition options.</param>
 public void Set(CompetitionOptions competitionOptions) => Options = competitionOptions ?? Options;