Esempio n. 1
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="location">The location to track.</param>
        public LocationTracker(GameLocation location)
        {
            this.Location = location;

            // init watchers
            this.BuildingsWatcher = location is BuildableGameLocation buildableLocation
                ? WatcherFactory.ForNetCollection(buildableLocation.buildings)
                : (ICollectionWatcher <Building>)WatcherFactory.ForObservableCollection(new ObservableCollection <Building>());

            this.DebrisWatcher = WatcherFactory.ForNetCollection(location.debris);
            this.LargeTerrainFeaturesWatcher = WatcherFactory.ForNetCollection(location.largeTerrainFeatures);
            this.NpcsWatcher            = WatcherFactory.ForNetCollection(location.characters);
            this.ObjectsWatcher         = WatcherFactory.ForNetDictionary(location.netObjects);
            this.TerrainFeaturesWatcher = WatcherFactory.ForNetDictionary(location.terrainFeatures);

            this.Watchers.AddRange(new IWatcher[]
            {
                this.BuildingsWatcher,
                this.DebrisWatcher,
                this.LargeTerrainFeaturesWatcher,
                this.NpcsWatcher,
                this.ObjectsWatcher,
                this.TerrainFeaturesWatcher
            });
        }
Esempio n. 2
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="location">The location to track.</param>
        public LocationTracker(GameLocation location)
        {
            this.Location = location;

            // init watchers
            this.ObjectsWatcher   = WatcherFactory.ForNetDictionary(location.netObjects);
            this.BuildingsWatcher = location is BuildableGameLocation buildableLocation
                ? WatcherFactory.ForNetCollection(buildableLocation.buildings)
                : (ICollectionWatcher <Building>)WatcherFactory.ForObservableCollection(new ObservableCollection <Building>());

            this.Watchers.AddRange(new IWatcher[]
            {
                this.BuildingsWatcher,
                this.ObjectsWatcher
            });
        }
Esempio n. 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);
 }
Esempio n. 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);
 }