/********* ** 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); }
/// <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); }
/********* ** 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); }
/********* ** 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); }
/********* ** 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); }