public override void LoadFromResponse(string apiname, dynamic data)
        {
            base.LoadFromResponse(apiname, (object)data);

            var progress = KCDatabase.Instance.QuestProgress;


            //周期任務削除
            if (DateTimeHelper.IsCrossedDay(progress.LastUpdateTime, 5, 0, 0))
            {
                progress.Progresses.RemoveAll(p => (p.QuestType == 1 || p.QuestID == 211 /* 空母3 */ || p.QuestID == 212 /* 輸送5 */ || p.QuestID == 311 /* 演習勝利7 */));
                Quests.RemoveAll(q => q.Type == 1 || q.QuestID == 211 /* 空母3 */ || q.QuestID == 212 /* 輸送5 */ || q.QuestID == 311 /* 演習勝利7 */);
            }
            if (DateTimeHelper.IsCrossedWeek(progress.LastUpdateTime, DayOfWeek.Monday, 5, 0, 0))
            {
                progress.Progresses.RemoveAll(p => p.QuestType == 2);
                Quests.RemoveAll(q => q.Type == 2);
            }
            if (DateTimeHelper.IsCrossedMonth(progress.LastUpdateTime, 1, 5, 0, 0))
            {
                progress.Progresses.RemoveAll(p => p.QuestType == 3);
                Quests.RemoveAll(q => q.Type == 3);
            }
            if (DateTimeHelper.IsCrossedQuarter(progress.LastUpdateTime, 0, 1, 5, 0, 0))
            {
                // "沖ノ島海域迎撃戦", "戦果拡張任務!「Z作戦」前段作戦" に限る
                progress.Progresses.RemoveAll(p => p.QuestID == 822 || p.QuestID == 854);
                Quests.RemoveAll(q => q.QuestID == 822 || q.QuestID == 854);
            }


            Count = (int)RawData.api_count;

            if (RawData.api_list != null)                       //任務完遂時orページ遷移時 null になる

            {
                foreach (dynamic elem in RawData.api_list)
                {
                    if (!(elem is double))                                      //空欄は -1 になるため。

                    {
                        int id = (int)elem.api_no;
                        if (!Quests.ContainsKey(id))
                        {
                            var q = new QuestData();
                            q.LoadFromResponse(apiname, elem);
                            Quests.Add(q);
                        }
                        else
                        {
                            Quests[id].LoadFromResponse(apiname, elem);
                        }
                    }
                }
            }


            IsLoaded = true;
        }
        public override void LoadFromResponse(string apiname, dynamic data)
        {
            base.LoadFromResponse(apiname, (object)data);

            var progress = KCDatabase.Instance.QuestProgress;


            //周期任務削除
            if (DateTimeHelper.IsCrossedDay(progress.LastUpdateTime, 5, 0, 0))
            {
                // 注: 311 = 精鋭艦隊演習; マンスリーだがデイリーで進捗リセット
                progress.Progresses.RemoveAll(p => (p.QuestType == 1 || p.QuestType == 5 || p.QuestID == 311));
                Quests.RemoveAll(q => q.Type == 1 || q.Type == 5 || q.QuestID == 311);
            }
            if (DateTimeHelper.IsCrossedWeek(progress.LastUpdateTime, DayOfWeek.Monday, 5, 0, 0))
            {
                progress.Progresses.RemoveAll(p => p.QuestType == 2);
                Quests.RemoveAll(q => q.Type == 2);
            }
            if (DateTimeHelper.IsCrossedMonth(progress.LastUpdateTime, 1, 5, 0, 0))
            {
                progress.Progresses.RemoveAll(p => p.QuestType == 3);
                Quests.RemoveAll(q => q.Type == 3);
            }


            Count = (int)RawData.api_count;

            if (RawData.api_list != null)                       //任務完遂時orページ遷移時 null になる

            {
                foreach (dynamic elem in RawData.api_list)
                {
                    if (!(elem is double))                                      //空欄は -1 になるため。

                    {
                        int id = (int)elem.api_no;
                        if (!Quests.ContainsKey(id))
                        {
                            var q = new QuestData();
                            q.LoadFromResponse(apiname, elem);
                            Quests.Add(q);
                        }
                        else
                        {
                            Quests[id].LoadFromResponse(apiname, elem);
                        }
                    }
                }
            }


            IsLoaded = true;
        }
Example #3
0
        public override void LoadFromResponse(string apiname, dynamic data)
        {
            base.LoadFromResponse(apiname, (object)data);


            //周期任務削除
            if (DateTimeHelper.IsCrossedDay(_prevTime, 5, 0, 0))
            {
                Quests.RemoveAll(q => q.Type == 2 || q.Type == 4 || q.Type == 5);
            }
            if (DateTimeHelper.IsCrossedWeek(_prevTime, DayOfWeek.Monday, 5, 0, 0))
            {
                Quests.RemoveAll(q => q.Type == 3);
            }
            if (DateTimeHelper.IsCrossedMonth(_prevTime, 1, 5, 0, 0))
            {
                Quests.RemoveAll(q => q.Type == 6);
            }


            Count = (int)RawData.api_count;

            if (RawData.api_list != null)                       //任務完遂時orページ遷移時 null になる

            {
                foreach (dynamic elem in RawData.api_list)
                {
                    if (!(elem is double))                                      //空欄は -1 になるため。

                    {
                        int id = (int)elem.api_no;
                        if (!Quests.ContainsKey(id))
                        {
                            var q = new QuestData();
                            q.LoadFromResponse(apiname, elem);
                            Quests.Add(q);
                        }
                        else
                        {
                            Quests[id].LoadFromResponse(apiname, elem);
                        }
                    }
                }
            }


            IsLoaded  = true;
            _prevTime = DateTime.Now;
        }
		public override void LoadFromResponse( string apiname, dynamic data ) {
			base.LoadFromResponse( apiname, (object)data );


			//周期任務削除
			if ( DateTimeHelper.IsCrossedDay( _prevTime, 5, 0, 0 ) ) {
				Quests.RemoveAll( q => q.Type == 2 || q.Type == 4 || q.Type == 5 );
			}
			if ( DateTimeHelper.IsCrossedWeek( _prevTime, DayOfWeek.Monday, 5, 0, 0 ) ) {
				Quests.RemoveAll( q => q.Type == 3 );
			}
			if ( DateTimeHelper.IsCrossedMonth( _prevTime, 1, 5, 0, 0 ) ) {
				Quests.RemoveAll( q => q.Type == 6 );
			}


			Count = (int)RawData.api_count;

			if ( RawData.api_list != null ) {	//任務完遂時orページ遷移時 null になる

				foreach ( dynamic elem in RawData.api_list ) {

					if ( !( elem is double ) ) {		//空欄は -1 になるため。

						int id = (int)elem.api_no;
						if ( !Quests.ContainsKey( id ) ) {
							var q = new QuestData();
							q.LoadFromResponse( apiname, elem );
							Quests.Add( q );

						} else {
							Quests[id].LoadFromResponse( apiname, elem );
						}

					}
				}

			}


			IsLoaded = true;
			_prevTime = DateTime.Now;

		}
		public override void LoadFromResponse( string apiname, dynamic data ) {
			base.LoadFromResponse( apiname, (object)data );

			var progress = KCDatabase.Instance.QuestProgress;


			//周期任務削除
			if ( DateTimeHelper.IsCrossedDay( progress.LastUpdateTime, 5, 0, 0 ) ) {
				// 注: 311 = 精鋭艦隊演習; マンスリーだがデイリーで進捗リセット
				progress.Progresses.RemoveAll( p => ( p.QuestType == 2 || p.QuestType == 4 || p.QuestType == 5 || p.QuestID == 311 ) );
				Quests.RemoveAll( q => q.Type == 2 || q.Type == 4 || q.Type == 5 || q.QuestID == 311 );
			}
			if ( DateTimeHelper.IsCrossedWeek( progress.LastUpdateTime, DayOfWeek.Monday, 5, 0, 0 ) ) {
				progress.Progresses.RemoveAll( p => p.QuestType == 3 );
				Quests.RemoveAll( q => q.Type == 3 );
			}
			if ( DateTimeHelper.IsCrossedMonth( progress.LastUpdateTime, 1, 5, 0, 0 ) ) {
				progress.Progresses.RemoveAll( p => p.QuestType == 6 );
				Quests.RemoveAll( q => q.Type == 6 );
			}


			Count = (int)RawData.api_count;

			if ( RawData.api_list != null ) {	//任務完遂時orページ遷移時 null になる

				foreach ( dynamic elem in RawData.api_list ) {

					if ( !( elem is double ) ) {		//空欄は -1 になるため。

						int id = (int)elem.api_no;
						if ( !Quests.ContainsKey( id ) ) {
							var q = new QuestData();
							q.LoadFromResponse( apiname, elem );
							Quests.Add( q );

						} else {
							Quests[id].LoadFromResponse( apiname, elem );
						}

					}
				}

			}


			IsLoaded = true;

		}