コード例 #1
0
        public MapViewModel(IZoneCompletionController zoneController, IZoneService zoneService, IPlayerService playerService,
                            ZoneItemsStore zoneItemsStore, MapUserData userData)
        {
            this.zoneController = zoneController;
            this.zoneService    = zoneService;
            this.userData       = userData;

            this.CharacterPointer = new CharacterPointerViewModel(zoneController, userData);
            this.CharacterPointer.PropertyChanged += CharacterPointer_PropertyChanged;

            this.MapMarkers = new MarkersViewModel(userData);
            this.ZoneItems  = new ZoneItemsViewModel(zoneItemsStore);

            if (playerService.HasValidMapId)
            {
                this.ContinentData = this.zoneService.GetContinentByMap(playerService.MapId);
            }
            else
            {
                this.ContinentData = this.zoneService.GetContinent(DEFAULT_CONTINENT_ID);
            }

            this.FloorId = 1;

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged;
            this.zoneController.Start();
        }
コード例 #2
0
        public MapViewModel(IZoneCompletionController zoneController, IZoneService zoneService, IPlayerService playerService,
                            PlayerMarkersViewModel mapMarkers, ZoneItemsViewModel zoneItems, MapUserData userData)
        {
            this.zoneController = zoneController;
            this.zoneService    = zoneService;
            this.userData       = userData;

            this.CharacterPointer = new CharacterPointerViewModel(zoneController, userData);
            this.CharacterPointer.PropertyChanged += CharacterPointer_PropertyChanged;
            this.Drawings = new DrawingsViewModel(this.CharacterPointer, zoneService, playerService, userData);

            this.MapMarkers = mapMarkers;
            this.ZoneItems  = zoneItems;

            // Make sure the zone service is ready
            this.zoneService.Initialize();

            if (playerService.HasValidMapId)
            {
                this.ContinentData = this.zoneService.GetContinentByMap(playerService.MapId);
            }
            else
            {
                this.ContinentData = this.zoneService.GetContinent(DEFAULT_CONTINENT_ID);
            }

            this.FloorId = 1;
            if (playerService.HasValidMapId)
            {
                this.FloorId = this.zoneService.GetMap(playerService.MapId).DefaultFloor;
            }

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged;
            this.zoneController.Start();
        }
コード例 #3
0
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="zoneItemsController">The zone completion controller</param>
        /// <param name="zoneName">The zone name view model</param>
        public ZoneCompletionView(IZoneCompletionController zoneItemsController, IHasZoneName zoneName)
        {
            logger.Debug("New ZoneCompletionView created");
            this.controller  = zoneItemsController;
            this.DataContext = new ZoneCompletionViewModel(this.controller, zoneName);
            InitializeComponent();

            // Save the height values for use when collapsing the window
            this.MinHeight = minHeight;
            this.Height    = Properties.Settings.Default.ZoneAssistantHeight;

            this.Closing += ZoneCompletionView_Closing;
            this.beforeCollapseHeight = this.Height;
        }
コード例 #4
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            logger.Debug("Initializing Zone Completion Module");

            this.zoneCompletionController = this.Container.GetExportedValue <IZoneCompletionController>();
            this.viewController           = this.Container.GetExportedValue <IZoneCompletionViewController>();

            // Register for shutdown
            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown));

            // Initialize the view controller
            this.viewController.Initialize();

            logger.Debug("Zone Completion Module initialized");
        }
コード例 #5
0
        /// <summary>
        /// Constructs a new CharacterPointerViewModel
        /// </summary>
        public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData)
        {
            this.zoneController = zoneController;
            this.userData       = userData;

            this.PlayerTrail = new ObservableCollection <Location>();

            this.DisplayCharacterPointer    = true;
            this.SnapToCharacter            = false;
            this.ShowPlayerTrail            = true;
            this.PlayerTrailLength          = 100;
            this.CanDisplayCharacterPointer = this.zoneController.ValidMapID;

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged;
        }
コード例 #6
0
        /// <summary>
        /// Constructs a new CharacterPointerViewModel
        /// </summary>
        public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData)
        {
            this.zoneController = zoneController;
            this.userData       = userData;

            this.PlayerTrail = new ObservableCollection <Location>();
            this.CanDisplayCharacterPointer = this.zoneController.ValidMapID;
            this.RefreshCharacterLocation();
            this.RefreshCharacterDirection();

            string validMapProp  = ReflectionUtility.GetPropertyName(() => this.zoneController.ValidMapID);
            string activeMapProp = ReflectionUtility.GetPropertyName(() => this.zoneController.ActiveMap);
            string charPosProp   = ReflectionUtility.GetPropertyName(() => this.zoneController.CharacterPosition);
            string camDirProp    = ReflectionUtility.GetPropertyName(() => this.zoneController.CameraDirection);

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += (o, e) =>
            {
                if (e.PropertyName == validMapProp)
                {
                    this.CanDisplayCharacterPointer = this.zoneController.ValidMapID;
                }
                else if (e.PropertyName == activeMapProp)
                {
                    this.RefreshCharacterLocation();
                    this.RefreshCharacterDirection();
                }
                else if (e.PropertyName == charPosProp)
                {
                    this.RefreshCharacterLocation();
                }
                else if (e.PropertyName == camDirProp)
                {
                    this.RefreshCharacterDirection();
                }
            };

            this.PlayerTrailColorOptions = new List <string>()
            {
                "#FFFFFF",
                "#000000",
                "#DD2C00",
                "#6200EA",
                "#2962FF",
                "#00C853",
                "#FFEA00",
                "#FF6D00"
            };
        }
コード例 #7
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            logger.Debug("Initializing Zone Completion Module");

            this.zoneCompletionController = this.Container.GetExportedValue<IZoneCompletionController>();
            this.viewController = this.Container.GetExportedValue<IZoneCompletionViewController>();

            // Initialize the zone items store on a background thread
            var zoneItemsStore = this.Container.GetExportedValue<ZoneItemsStore>();
            Task.Factory.StartNew(zoneItemsStore.InitializeStore);


            // Register for shutdown
            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown));

            // Initialize the view controller
            this.viewController.Initialize();

            logger.Debug("Zone Completion Module initialized");
        }
コード例 #8
0
        /// <summary>
        /// Notifies the module that it has be initialized.
        /// </summary>
        public void Initialize()
        {
            logger.Debug("Initializing Zone Completion Module");

            this.zoneCompletionController = this.Container.GetExportedValue <IZoneCompletionController>();
            this.viewController           = this.Container.GetExportedValue <IZoneCompletionViewController>();

            // Initialize the zone items store on a background thread
            var zoneItemsStore = this.Container.GetExportedValue <ZoneItemsStore>();

            Task.Factory.StartNew(zoneItemsStore.InitializeStore);


            // Register for shutdown
            Commands.ApplicationShutdownCommand.RegisterCommand(new DelegateCommand(this.Shutdown));

            // Initialize the view controller
            this.viewController.Initialize();

            logger.Debug("Zone Completion Module initialized");
        }
コード例 #9
0
        public ZoneItemsViewModel(ZoneItemsStore zoneItemsStore, IZoneCompletionController zoneController, MapUserData userData)
        {
            this.zoneItemsStore = zoneItemsStore;
            this.zoneController = zoneController;
            this.userData       = userData;

            this.ShowHeartQuests = true;
            this.ShowHeroPoints  = true;
            this.ShowPOIs        = true;
            this.ShowVistas      = true;
            this.ShowWaypoints   = true;
            this.ShowDungeons    = true;

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += (o, e) =>
            {
                if (!this.userData.ShowEntireContinent && e.PropertyName.ToLower().Contains("map"))
                {
                    this.OnPropertyChanged(() => this.Waypoints);
                    this.OnPropertyChanged(() => this.POIs);
                    this.OnPropertyChanged(() => this.Vistas);
                    this.OnPropertyChanged(() => this.HeartQuests);
                    this.OnPropertyChanged(() => this.HeroPoints);
                    this.OnPropertyChanged(() => this.Dungeons);
                }
            };

            this.zoneItemsStore.DataLoaded += (o, e) =>
            {
                this.OnPropertyChanged(() => this.Waypoints);
                this.OnPropertyChanged(() => this.POIs);
                this.OnPropertyChanged(() => this.Vistas);
                this.OnPropertyChanged(() => this.HeartQuests);
                this.OnPropertyChanged(() => this.HeroPoints);
                this.OnPropertyChanged(() => this.Dungeons);
            };
        }
コード例 #10
0
ファイル: ZoneItemsViewModel.cs プロジェクト: SamHurne/gw2pao
        public ZoneItemsViewModel(ZoneItemsStore zoneItemsStore, IZoneCompletionController zoneController, MapUserData userData)
        {
            this.zoneItemsStore = zoneItemsStore;
            this.zoneController = zoneController;
            this.userData = userData;

            this.ShowHeartQuests = true;
            this.ShowHeroPoints = true;
            this.ShowPOIs = true;
            this.ShowVistas = true;
            this.ShowWaypoints = true;
            this.ShowDungeons = true;

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += (o, e) =>
            {
                if (!this.userData.ShowEntireContinent && e.PropertyName.ToLower().Contains("map"))
                {
                    this.OnPropertyChanged(() => this.Waypoints);
                    this.OnPropertyChanged(() => this.POIs);
                    this.OnPropertyChanged(() => this.Vistas);
                    this.OnPropertyChanged(() => this.HeartQuests);
                    this.OnPropertyChanged(() => this.HeroPoints);
                    this.OnPropertyChanged(() => this.Dungeons);
                }
            };

            this.zoneItemsStore.DataLoaded += (o, e) =>
            {
                this.OnPropertyChanged(() => this.Waypoints);
                this.OnPropertyChanged(() => this.POIs);
                this.OnPropertyChanged(() => this.Vistas);
                this.OnPropertyChanged(() => this.HeartQuests);
                this.OnPropertyChanged(() => this.HeroPoints);
                this.OnPropertyChanged(() => this.Dungeons);
            };
        }
コード例 #11
0
        /// <summary>
        /// Constructs a new CharacterPointerViewModel
        /// </summary>
        public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData)
        {
            this.zoneController = zoneController;
            this.userData = userData;

            this.PlayerTrail = new ObservableCollection<Location>();
            this.CanDisplayCharacterPointer = this.zoneController.ValidMapID;
            this.RefreshCharacterLocation();
            this.RefreshCharacterDirection();

            string validMapProp = ReflectionUtility.GetPropertyName(() => this.zoneController.ValidMapID);
            string activeMapProp = ReflectionUtility.GetPropertyName(() => this.zoneController.ActiveMap);
            string charPosProp = ReflectionUtility.GetPropertyName(() => this.zoneController.CharacterPosition);
            string camDirProp = ReflectionUtility.GetPropertyName(() => this.zoneController.CameraDirection);
            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += (o, e) =>
            {
                if (e.PropertyName == validMapProp)
                {
                    this.CanDisplayCharacterPointer = this.zoneController.ValidMapID;
                }
                else if (e.PropertyName == activeMapProp)
                {
                    this.RefreshCharacterLocation();
                    this.RefreshCharacterDirection();
                }
                else if (e.PropertyName == charPosProp)
                {
                    this.RefreshCharacterLocation();
                }
                else if (e.PropertyName == camDirProp)
                {
                    this.RefreshCharacterDirection();
                }
            };

            this.PlayerTrailColorOptions = new List<string>()
            {
                "#FFFFFF",
                "#000000",
                "#DD2C00",
                "#6200EA",
                "#2962FF",
                "#00C853",
                "#FFEA00",
                "#FF6D00"
            };
        }
コード例 #12
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="zoneCompletionController">The zone completion controller</param>
 /// <param name="zoneNameVm">The zone name view model</param>
 public ZoneCompletionViewModel(IZoneCompletionController zoneCompletionController, IHasZoneName zoneNameVm)
 {
     this.controller = zoneCompletionController;
     this.ZoneNameVM = zoneNameVm;
 }
コード例 #13
0
 public ZoneCompletionViewModel(IZoneCompletionController zoneCompletionController)
 {
     this.controller = zoneCompletionController;
     this.controller.Start();
 }
コード例 #14
0
ファイル: MapViewModel.cs プロジェクト: reecebedding/gw2pao
        public MapViewModel(IZoneCompletionController zoneController, IZoneService zoneService, IPlayerService playerService,
            ZoneItemsStore zoneItemsStore, MapUserData userData)
        {
            this.zoneController = zoneController;
            this.zoneService = zoneService;
            this.userData = userData;

            this.CharacterPointer = new CharacterPointerViewModel(zoneController, userData);
            this.CharacterPointer.PropertyChanged += CharacterPointer_PropertyChanged;

            this.MapMarkers = new MarkersViewModel(userData);
            this.ZoneItems = new ZoneItemsViewModel(zoneItemsStore);

            if (playerService.HasValidMapId)
                this.ContinentData = this.zoneService.GetContinentByMap(playerService.MapId);
            else
                this.ContinentData = this.zoneService.GetContinent(DEFAULT_CONTINENT_ID);

            this.FloorId = 1;

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged;
            this.zoneController.Start();
        }
コード例 #15
0
 public ZoneCompletionViewModel(IZoneCompletionController zoneCompletionController)
 {
     this.controller = zoneCompletionController;
     this.controller.Start();
 }
コード例 #16
0
        /// <summary>
        /// Constructs a new CharacterPointerViewModel
        /// </summary>
        public CharacterPointerViewModel(IZoneCompletionController zoneController, MapUserData userData)
        {
            this.zoneController = zoneController;
            this.userData = userData;

            this.PlayerTrail = new ObservableCollection<Location>();

            this.DisplayCharacterPointer = true;
            this.SnapToCharacter = false;
            this.ShowPlayerTrail = true;
            this.PlayerTrailLength = 100;
            this.CanDisplayCharacterPointer = this.zoneController.ValidMapID;

            ((INotifyPropertyChanged)this.zoneController).PropertyChanged += ZoneControllerPropertyChanged;
        }