Example #1
0
    //进度值有改变
    void _Packet(ScWeflareMoney p)
    {
        PWeflareInfo info = null;

        bool have = m_puzzleList.Exists(a => a.id == p.id);

        if (have)
        {
            SetWelfarweChange(info, m_puzzleList, p);
        }
        else
        {
            SetWelfarweChange(info, m_allWeflarInfo, p);
        }

        var puzzle = m_puzzleList.Find(a => a.id == p.id);
        var other  = m_allWeflarInfo.Find(a => a.id == p.id);

        if (other != null && puzzle != null)
        {
            m_allWeflarInfo.Remove(other);
            m_allWeflarInfo.Add(puzzle);
            m_allWeflarInfo.Sort((a, b) => a.priority.CompareTo(b.priority));
        }

        if (chooseInfo == null || info == null)
        {
            return;
        }
        DispatchModuleEvent(EventWelfareMoneyChange, info);
    }
Example #2
0
 private void SetWelfarweChange(PWeflareInfo info, List <PWeflareInfo> list, ScWeflareMoney p)
 {
     for (int i = 0; i < list.Count; i++)
     {
         if (list[i] == null)
         {
             continue;
         }
         if (list[i].id == p.id)
         {
             SetProgress(list[i], p.type, p.money, p.taskID);
             info = list[i];
             break;
         }
     }
 }