Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="autoTracker">
 /// The autotracker data.
 /// </param>
 /// <param name="items">
 /// The item dictionary.
 /// </param>
 /// <param name="requirements">
 /// The requirement dictionary.
 /// </param>
 /// <param name="boolFactory">
 /// An Autofac factory creating address boolean autotrack values.
 /// </param>
 /// <param name="valueFactory">
 /// An Autofac factory creating address value autotrack values.
 /// </param>
 /// <param name="bitwiseIntegerFactory">
 /// An Autofac factory creating bitwise integer autotrack values.
 /// </param>
 /// <param name="conditionalFactory">
 /// An Autofac factory creating conditional autotrack values.
 /// </param>
 /// <param name="flagBoolFactory">
 /// An Autofac factory creating flag boolean autotrack values.
 /// </param>
 /// <param name="itemValueFactory">
 /// An Autofac factory creating item value autotrack values.
 /// </param>
 /// <param name="differenceFactory">
 /// An Autofac factory creating difference autotrack values.
 /// </param>
 /// <param name="overrideFactory">
 /// An Autofac factory creating override autotrack values.
 /// </param>
 /// <param name="sumFactory">
 /// An Autofac factory creating sum autotrack values.
 /// </param>
 /// <param name="staticValueFactory">
 /// An Autofac factory creating static autotrack values.
 /// </param>
 /// <param name="memoryFlagFactory">
 /// An Autofac factory creating memory flags.
 /// </param>
 public SectionAutoTrackingFactory(
     IAutoTracker autoTracker, IItemDictionary items, IRequirementDictionary requirements,
     AutoTrackAddressBool.Factory boolFactory, AutoTrackAddressValue.Factory valueFactory,
     AutoTrackBitwiseIntegerValue.Factory bitwiseIntegerFactory,
     AutoTrackConditionalValue.Factory conditionalFactory,
     AutoTrackFlagBool.Factory flagBoolFactory, AutoTrackItemValue.Factory itemValueFactory,
     AutoTrackMultipleDifference.Factory differenceFactory,
     AutoTrackMultipleOverride.Factory overrideFactory,
     AutoTrackMultipleSum.Factory sumFactory, AutoTrackStaticValue.Factory staticValueFactory,
     IMemoryFlag.Factory memoryFlagFactory)
 {
     _autoTracker           = autoTracker;
     _items                 = items;
     _requirements          = requirements;
     _boolFactory           = boolFactory;
     _valueFactory          = valueFactory;
     _bitwiseIntegerFactory = bitwiseIntegerFactory;
     _conditionalFactory    = conditionalFactory;
     _flagBoolFactory       = flagBoolFactory;
     _itemValueFactory      = itemValueFactory;
     _differenceFactory     = differenceFactory;
     _overrideFactory       = overrideFactory;
     _sumFactory            = sumFactory;
     _staticValueFactory    = staticValueFactory;
     _memoryFlagFactory     = memoryFlagFactory;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="autoTracker">
        /// The autotracker data.
        /// </param>
        /// <param name="expectedValue">
        /// A boolean expected race illegal tracking requirement value.
        /// </param>
        public RaceIllegalTrackingRequirement(IAutoTracker autoTracker, bool expectedValue)
        {
            _autoTracker   = autoTracker;
            _expectedValue = expectedValue;

            _autoTracker.PropertyChanged += OnAutoTrackerChanged;

            UpdateValue();
        }
Exemplo n.º 3
0
        public void TrackWorkloadThrowsOnNullTracker()
        {
            // arrange
            IAutoTracker tracker  = null;
            Action       workload = null;

            // act
            var ex = Assert.Throws <ArgumentNullException>(() => tracker.Track(workload));

            // assert
            Assert.Equal(nameof(tracker), ex.ParamName);
        }
Exemplo n.º 4
0
        public void TrackWorkloadWithScopeAndResultThrowsOnNullTracker()
        {
            // arrange
            IAutoTracker tracker = null;
            Func <ITrackingScope, int> workload = null;

            // act
            var ex = Assert.Throws <ArgumentNullException>(() => tracker.Track(workload));

            // assert
            Assert.Equal(nameof(tracker), ex.ParamName);
        }
Exemplo n.º 5
0
        /// <inheritdoc cref="IAutoTracker.Track{TResult}(Func{ITrackingScope, CancellationToken, TResult}, CancellationToken)"/>
        public static TResult Track <TResult>(this IAutoTracker tracker, Func <TResult> workload)
        {
            if (tracker is null)
            {
                throw new ArgumentNullException(nameof(tracker));
            }
            if (workload is null)
            {
                throw new ArgumentNullException(nameof(workload));
            }

            return(tracker.Track((scope, token) => workload()));
        }
Exemplo n.º 6
0
        /// <inheritdoc cref="IAutoTracker.Track(Action{ITrackingScope, CancellationToken}, CancellationToken)"/>
        public static void Track(this IAutoTracker tracker, Action workload)
        {
            if (tracker is null)
            {
                throw new ArgumentNullException(nameof(tracker));
            }
            if (workload is null)
            {
                throw new ArgumentNullException(nameof(workload));
            }

            tracker.Track((scope, token) => workload());
        }
Exemplo n.º 7
0
        /// <inheritdoc cref="IAutoTracker.TrackAsync{TResult}(Func{ITrackingScope, CancellationToken, Task{TResult}}, CancellationToken)"/>
        public static Task <TResult> TrackAsync <TResult>(this IAutoTracker tracker, Func <ITrackingScope, Task <TResult> > workload)
        {
            if (tracker is null)
            {
                throw new ArgumentNullException(nameof(tracker));
            }
            if (workload is null)
            {
                throw new ArgumentNullException(nameof(workload));
            }

            return(tracker.TrackAsync((scope, token) => workload(scope)));
        }
Exemplo n.º 8
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ResetManager(
     IAutoTracker autoTracker, IBossPlacementDictionary bossPlacements, IConnectionCollection connections,
     IDropdownDictionary dropdowns, IItemDictionary items, ILocationDictionary locations,
     IPinnedLocationCollection pinnedLocations, IPrizePlacementDictionary prizePlacements,
     IUndoRedoManager undoRedoManager)
 {
     _autoTracker     = autoTracker;
     _bossPlacements  = bossPlacements;
     _connections     = connections;
     _dropdowns       = dropdowns;
     _items           = items;
     _locations       = locations;
     _pinnedLocations = pinnedLocations;
     _prizePlacements = prizePlacements;
     _undoRedoManager = undoRedoManager;
 }