예제 #1
0
    private void CreateDailyUIList()
    {
        if (null != m_ctor_ContentScrollView)
        {
            dailyDataList.Clear();
            List <DailyDataBase> tempDaliyList = new List <DailyDataBase>();
            DataManager.Manager <DailyManager>().ExecuteSort();
            IPlayer mp = ClientGlobal.Instance().MainPlayer;
            if (mp == null)
            {
                return;
            }
            int playerLevel             = mp.GetProp((int)CreatureProp.Level);
            List <LivenessData> allList = DataManager.Manager <DailyManager>().FormDailyData(curDailyType);
            for (int i = 0; i < allList.Count; i++)
            {
                uint id = allList[i].type;
                table.DailyDataBase data = GameTableManager.Instance.GetTableItem <DailyDataBase>(id);
                if (playerLevel >= data.minLevel)
                {
                    dailyDataList.Add(data);
                }
                else
                {
                    tempDaliyList.Add(data);
                }
            }
            if (tempDaliyList.Count > 0)
            {
                dailyDataList.AddRange(tempDaliyList);
            }
            m_lstDailyID.Clear();
            for (int i = 0; i < dailyDataList.Count; i++)
            {
                m_lstDailyID.Add(dailyDataList[i].id);
            }

            if (dailyDataList != null)
            {
                m_ctor_ContentScrollView.CreateGrids(dailyDataList.Count);
            }
            if (m_lstDailyID.Count > 0)
            {
                SetSelectDailyGrid(m_lstDailyID[0]);
            }
        }
    }
예제 #2
0
    /// <summary>
    /// 构建日程信息
    /// </summary>
    public void StructScheduleInfo(DailyDataBase daily)
    {
        scheduleInfos = new List <ScheduleDefine.ScheduleLocalData>();
        table.DailyDataBase dailyData = daily;
        if (null != dailyData && !string.IsNullOrEmpty(dailyData.ScheduleId))
        {
            string[] scheduleIdArray = dailyData.ScheduleId.Split(new char[] { '_' });
            if (null != scheduleIdArray)
            {
                ScheduleDefine.ScheduleLocalData scheduleTemp = null;
                for (int i = 0; i < scheduleIdArray.Length; i++)
                {
                    scheduleTemp = new ScheduleDefine.ScheduleLocalData(uint.Parse(scheduleIdArray[i].Trim()));
                    scheduleInfos.Add(scheduleTemp);
                }

                if (!m_scheduleDic.ContainsKey(daily.id))
                {
                    m_scheduleDic.Add(daily.id, scheduleInfos);
                }
            }
        }
    }