public static LocalCampSignInfo Create(GameCmd.stCampSignInfo info) { LocalCampSignInfo ci = new LocalCampSignInfo(); ci.UpdateData(info); return(ci); }
public void UpdateData(GameCmd.stCampSignInfo info) { m_uIndex = info.index; m_emState = (GameCmd.eCFState)info.state; TimeSpan ts = new TimeSpan(0, 0, (int)info.sign_time); string tempStr1 = string.Format("{0}:{1}", ts.Hours.ToString("D2"), ts.Minutes.ToString("D2")); ts = new TimeSpan(0, 0, (int)info.begin_time); string tempStr2 = string.Format("{0}:{1}", ts.Hours.ToString("D2"), ts.Minutes.ToString("D2")); m_strSignTime = string.Format("{0}-{1}", tempStr1, tempStr2); m_strStartTime = string.Format("{0}:{1}", ts.Hours.ToString("D2"), ts.Minutes.ToString("D2")); ts = new TimeSpan(0, 0, (int)info.end_time); m_strEndTime = string.Format("{0}:{1}", ts.Hours.ToString("D2"), ts.Minutes.ToString("D2")); //更新 m_lstSignNum.Clear(); if (null != info.num) { m_lstSignNum.AddRange(info.num); } //持续时长 m_iCampDuration = Math.Max(0, (int)info.end_time - (int)info.begin_time); }