コード例 #1
0
        internal SortieViewModel()
        {
            ApiService.Subscribe("api_req_map/start", delegate
            {
                Info = SortieInfo.Current;
                Type = DisplayType.Sortie;
            });

            ApiService.Subscribe("api_req_member/get_practice_enemyinfo", delegate
            {
                Info = KanColleGame.Current.Sortie;
                Type = DisplayType.Practice;
            });

            ApiService.Subscribe("api_port/port", _ =>
            {
                Info = null;
                Type = DisplayType.MapGauge;
            });

            ApiService.SubscribeOnce("api_get_member/require_info", delegate
            {
                ShipLockingService.Instance.Initialize();

                var rMasterInfo = KanColleGame.Current.MasterInfo;
                if (ShipLockingService.Instance.ShipLocking.Count > 0 && rMasterInfo.EventMapCount > 0)
                {
                    var rEventMaps = from rArea in rMasterInfo.MapAreas.Values
                                     where rArea.IsEventArea
                                     join rMap in rMasterInfo.Maps.Values on rArea.ID equals rMap.AreaID
                                     select rMap;

                    EventMaps = new EventMapOverviewViewModel(rEventMaps.ToArray());
                    OnPropertyChanged(nameof(EventMaps));
                }
            });
        }
コード例 #2
0
        internal SortieViewModel()
        {
            SessionService.Instance.Subscribe("api_req_map/start", delegate
            {
                Info = SortieInfo.Current;
                Type = DisplayType.Sortie;
            });

            SessionService.Instance.Subscribe("api_req_member/get_practice_enemyinfo", delegate
            {
                Info = KanColleGame.Current.Sortie;
                Type = DisplayType.Practice;
            });

            SessionService.Instance.Subscribe("api_port/port", _ =>
            {
                Info = null;
                Type = DisplayType.MapGauge;
            });

            SessionService.Instance.SubscribeOnce("api_get_member/require_info", delegate
            {
                ShipLockingService.Instance.Initialize();

                var rMasterInfo = KanColleGame.Current.MasterInfo;
                if (ShipLockingService.Instance.ShipLocking.Count > 0 && rMasterInfo.EventMapCount > 0)
                {
                    var rEventMaps = from rArea in rMasterInfo.MapAreas.Values
                                     where rArea.IsEventArea
                                     join rMap in rMasterInfo.Maps.Values on rArea.ID equals rMap.AreaID
                                     select rMap;

                    EventMaps = new EventMapOverviewViewModel(rEventMaps.ToArray());
                    OnPropertyChanged(nameof(EventMaps));
                }
            });
        }