示例#1
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="chest">The chest being tracked.</param>
        public ChestTracker(Chest chest)
        {
            this.Chest            = chest;
            this.InventoryWatcher = WatcherFactory.ForNetList(chest.items);

            this.StackSizes = this.Chest.items
                              .Where(n => n != null)
                              .Distinct()
                              .ToDictionary(n => n, n => n.Stack);
        }
示例#2
0
 /// <summary>Update the snapshot.</summary>
 /// <param name="watcher">The value watcher to snapshot.</param>
 public void Update(ICollectionWatcher <T> watcher)
 {
     this.Update(watcher.IsChanged, watcher.Removed, watcher.Added);
 }
示例#3
0
 /*********
 ** Public methods
 *********/
 /// <summary>Construct an instance.</summary>
 /// <param name="locations">The game's list of locations.</param>
 /// <param name="activeMineLocations">The game's list of active mine locations.</param>
 /// <param name="activeVolcanoLocations">The game's list of active volcano locations.</param>
 public WorldLocationsTracker(ObservableCollection <GameLocation> locations, IList <MineShaft> activeMineLocations, IList <VolcanoDungeon> activeVolcanoLocations)
 {
     this.LocationListWatcher        = WatcherFactory.ForObservableCollection(locations);
     this.MineLocationListWatcher    = WatcherFactory.ForReferenceList(activeMineLocations);
     this.VolcanoLocationListWatcher = WatcherFactory.ForReferenceList(activeVolcanoLocations);
 }
示例#4
0
 /*********
 ** Public methods
 *********/
 /// <summary>Construct an instance.</summary>
 /// <param name="locations">The game's list of locations.</param>
 public WorldLocationsTracker(ObservableCollection <GameLocation> locations)
 {
     this.LocationListWatcher = WatcherFactory.ForObservableCollection(locations);
 }
示例#5
0
 /*********
 ** Public methods
 *********/
 /// <summary>Construct an instance.</summary>
 /// <param name="locations">The game's list of locations.</param>
 /// <param name="activeMineLocations">The game's list of active mine locations.</param>
 public WorldLocationsTracker(List <GameLocation> locations, IList <MineShaft> activeMineLocations)
 {
     this.LocationListWatcher     = WatcherFactory.ForReferenceList(locations);
     this.MineLocationListWatcher = WatcherFactory.ForReferenceList(activeMineLocations);
 }