public override bool InitWithJson(JsonData data)
 {
     foreach (string key in data.Keys)
     {
         if (key == IdleRewardDataKey.START_TIME)
         {
             startTimestamp = PTUtil.JsonData2Timestamp(data[key]);
         }
         else if (key == IdleRewardDataKey.SETTLEMENT_TIME)
         {
             settlementTimestamp = PTUtil.JsonData2Timestamp(data[key]);
         }
         else if (key == IdleRewardDataKey.SETTLEMENT_DATAS)
         {
             var subJson = data[key];
             for (int i = 0; i < subJson.Count; i++)
             {
                 IdleRewardSettlementData settlement = new IdleRewardSettlementData();
                 settlement.InitWithJson(subJson[i]);
                 settlementList.Add(settlement);
             }
         }
         else if (key == IdleRewardDataKey.QUICK_IDLE_INDEX)
         {
             quickIdleIndex = (int)data[key];
         }
     }
     return(true);
 }
Exemple #2
0
 public override bool InitWithJson(JsonData data)
 {
     foreach (string key in data.Keys)
     {
         if (key == ServerTimeDataKey.LOCAL_TIME_SPAN)
         {
             localTimeSpan = PTUtil.JsonData2Timestamp(data[key]);
         }
         else if (key == ServerTimeDataKey.REFRESH_TIME_ONE_DAY)
         {
             refreshTime_OneDay = PTUtil.JsonData2DateTime(data[key]);
         }
         else if (key == ServerTimeDataKey.REFRESH_TIME_TWO_DAY)
         {
             refreshTime_TwoDay = PTUtil.JsonData2DateTime(data[key]);
         }
         else if (key == ServerTimeDataKey.REFRESH_TIME_ONE_WEEK)
         {
             refreshTime_OneWeek = PTUtil.JsonData2DateTime(data[key]);
         }
     }
     return(true);
 }