Beispiel #1
0
        public int PosIndex;                 //排序时所在的位置

        public UserEncourageActVo(UserEncourageActPB userEncourageActPb)
        {
            Id                   = userEncourageActPb.Id;
            UserId               = userEncourageActPb.UserId;
            ActId                = userEncourageActPb.ActId;
            StartState           = userEncourageActPb.StartState;
            ImmediateFinishState = userEncourageActPb.ImmediateFinishState;
            AwardState           = userEncourageActPb.AwardState;
            AcceptTime           = userEncourageActPb.AcceptTime;
            NeedToChangeAni      = false;
        }
Beispiel #2
0
    public void UpdateEncourageActs(UserEncourageActPB userEncourageActVo, int replaceId = 0)
    {
        if (UserEncourageActVos == null)
        {
            Debug.LogError("BUG!USERdata is null");
            return;
        }


        foreach (var v in UserEncourageActVos)
        {
            // Debug.LogError(userEncourageActVo);
            if (v.ActId == userEncourageActVo.ActId)
            {
                v.Id         = userEncourageActVo.Id;
                v.UserId     = userEncourageActVo.UserId;
                v.AcceptTime = userEncourageActVo.AcceptTime;
                v.AwardState = userEncourageActVo.AwardState;
                //Debug.LogError("userEncourageActVo.AwardState"+userEncourageActVo.AwardState);
                v.ImmediateFinishState = userEncourageActVo.ImmediateFinishState;
                if (v.ImmediateFinishState == 1)
                {
//                        Debug.LogError("ImmediateFinishState");
                }

                v.StartState            = userEncourageActVo.StartState;
                v.UserId                = userEncourageActVo.UserId;
                RefreshUserStartActItem = v;
                return;
            }
        }

        if (replaceId != userEncourageActVo.ActId)
        {
//                Debug.LogError("replace new task!");
            var removeItem = UserEncourageActVos.Find(x => x.ActId == replaceId);
//                UserEncourageActVos.Remove(removeItem);
//                UserEncourageActVo vo=new UserEncourageActVo(userEncourageActVo);
//                UserEncourageActVos.Add(vo);
            foreach (var v in UserEncourageActVos)
            {
                if (v.ActId == replaceId)
                {
                    v.ActId      = userEncourageActVo.ActId;
                    v.Id         = userEncourageActVo.Id;
                    v.UserId     = userEncourageActVo.UserId;
                    v.AcceptTime = userEncourageActVo.AcceptTime;
                    v.AwardState = userEncourageActVo.AwardState;
                    //Debug.LogError("userEncourageActVo.AwardState"+userEncourageActVo.AwardState);
                    v.ImmediateFinishState = userEncourageActVo.ImmediateFinishState;
                    if (v.ImmediateFinishState == 1)
                    {
//                        Debug.LogError("ImmediateFinishState");
                    }

                    v.StartState            = userEncourageActVo.StartState;
                    v.NeedToChangeAni       = false;
                    v.CanReceiveAward       = false;
                    RefreshUserStartActItem = v;
                }
            }


//                Debug.LogError(UserEncourageActVos.Count);
        }
    }