Example #1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="zoneItem">The zone item/point's information</param>
        /// <param name="userData">User data</param>
        public ZoneItemViewModel(ZoneItem zoneItem, IPlayerService playerService, ZoneCompletionUserData userData)
        {
            this.DistanceFromPlayer        = -1;
            this.ItemModel                 = zoneItem;
            this.playerService             = playerService;
            this.userData                  = userData;
            this.userData.PropertyChanged += (o, e) => this.RefreshVisibility();

            // Set up handling for collection changed events on the unlocked zone items collections
            foreach (CharacterZoneItems charItems in this.userData.UnlockedZoneItems)
            {
                charItems.ZoneItems.CollectionChanged += UnlockedZoneItems_CollectionChanged;
            }
            this.userData.UnlockedZoneItems.CollectionChanged += (o, e) =>
            {
                if (e.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (CharacterZoneItems itemAdded in e.NewItems)
                    {
                        itemAdded.ZoneItems.CollectionChanged += UnlockedZoneItems_CollectionChanged;
                    }
                }
            };
            this.userData.UnlockedZoneItems.CollectionChanged += UnlockedZoneItems_CollectionChanged;

            this.RefreshVisibility();
        }
Example #2
0
        public ZoneItemsStore(IZoneService zoneService, IPlayerService playerService, ZoneCompletionUserData zoneUserData)
        {
            this.zoneService = zoneService;
            this.playerService = playerService;
            this.zoneUserData = zoneUserData;

            this.Data = new Dictionary<int, ContinentZoneItems>(); 
        }
Example #3
0
        public ZoneItemsStore(IZoneService zoneService, IPlayerService playerService, ZoneCompletionUserData zoneUserData)
        {
            this.zoneService   = zoneService;
            this.playerService = playerService;
            this.zoneUserData  = zoneUserData;

            this.Data = new Dictionary <int, ContinentZoneItems>();
        }
Example #4
0
        public ZoneItemsStore(IZoneService zoneService, IPlayerService playerService, ZoneCompletionUserData zoneUserData)
        {
            this.zoneService   = zoneService;
            this.playerService = playerService;
            this.zoneUserData  = zoneUserData;

            this.Data = new Dictionary <int, ContinentZoneItems>();

            var continents = this.zoneService.GetContinents();

            foreach (var continent in continents)
            {
                this.Data.Add(continent.Id, new ContinentZoneItems(continent.Id));
            }
        }
        public ZoneCompletionController(IZoneService zoneService, IPlayerService playerService, ISystemService systemService, IHasZoneName zoneNameObject, ZoneCompletionUserData userData)
        {
            logger.Debug("Initializing Zone Completion Controller");
            this.zoneService = zoneService;
            this.playerService = playerService;
            this.systemService = systemService;
            this.zoneNameObject = zoneNameObject;
            this.isStopped = false;

            this.CharacterPosition = new API.Data.Entities.Point();
            this.CameraDirection = new API.Data.Entities.Point();

            this.UserData = userData;

            // Initialize refresh timers
            this.zoneRefreshTimer = new Timer(this.RefreshZone);
            this.ZoneRefreshInterval = 1000;
            this.itemLocationsRefreshTimer = new Timer(this.RefreshLocations);
            this.LocationsRefreshInterval = 250; // TODO: Tweak this until we get good performance without sucking up the CPU

            this.startCallCount = 0;
            this.CurrentMapID = -1;
            logger.Info("Zone Completion Controller initialized");
        }
Example #6
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="zoneItem">The zone item/point's information</param>
        /// <param name="userData">User data</param>
        public ZoneItemViewModel(ZoneItem zoneItem, IPlayerService playerService, ZoneCompletionUserData userData)
        {
            this.DistanceFromPlayer = -1;
            this.ItemModel = zoneItem;
            this.playerService = playerService;
            this.userData = userData;
            this.userData.PropertyChanged += (o, e) => this.RefreshVisibility();

            // Set up handling for collection changed events on the unlocked zone items collections
            foreach (CharacterZoneItems charItems in this.userData.UnlockedZoneItems)
            {
                charItems.ZoneItems.CollectionChanged += UnlockedZoneItems_CollectionChanged;
            }
            this.userData.UnlockedZoneItems.CollectionChanged += (o, e) =>
            {
                if (e.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (CharacterZoneItems itemAdded in e.NewItems)
                    {
                        itemAdded.ZoneItems.CollectionChanged += UnlockedZoneItems_CollectionChanged;
                    }
                }
            };
            this.userData.UnlockedZoneItems.CollectionChanged += UnlockedZoneItems_CollectionChanged;

            this.RefreshVisibility();
        }