Exemple #1
0
        public bool IsUpperLimited(ElementTypePB typePb)
        {
            int max = 0;
            int cur = 0;

            switch (typePb)
            {
            case ElementTypePB.Image:
                max = MaxImageCount;
                cur = CurImageCount;
                break;

            case ElementTypePB.Text:
                max = MaxTextCount;
                cur = CurTextCount;
                break;

            case ElementTypePB.Racket:
                max = MaxRacketCount;
                cur = CurRacketCount;
                break;

            default:
                return(false);
            }
            return(cur >= max);
        }
        /// <summary>
        /// 获取头像(框)路径
        /// </summary>
        /// <param name="id"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public string GetHeadPath(int id, ElementTypePB type)
        {
            string path = "";

            foreach (var rule in _rules)
            {
                if (rule.Id == id)
                {
                    if (type == ElementTypePB.AvatarBox)
                    {
                        path = "HeadFrame/" + rule.Id;
                        break;
                    }
                    else if (type == ElementTypePB.Avatar)
                    {
                        var isOther = rule.UnlockClaim.CardId == 0;
                        if (isOther)
                        {
                            path = "Head/OtherHead/" + rule.Id;
                        }
                        else
                        {
                            var isEvolutionBefore = rule.Id % 100 == 11;
                            path = isEvolutionBefore ? "Head/" + rule.Id / 100 : "Head/EvolutionHead/" + rule.Id / 100;
                        }
                        break;
                    }
                }
            }
            return(path);
        }
Exemple #3
0
 public HeadVo(ElementPB pb)
 {
     Id            = pb.Id;
     ElementType   = pb.ElementType;
     ElementModule = pb.ElementModule;
     Name          = pb.Name;
     NeedUnlock    = pb.NeedUnlock;
     UnlockClaim   = pb.UnlockClaim;
     _userCardVo   = GlobalData.CardModel.GetUserCardById(UnlockClaim.CardId);
     Desc          = pb.Desc;
     SetPlayerTypeAndPath(pb.UnlockClaim.CardId, pb.Id);
     SetIsUnlock();
 }
Exemple #4
0
        public void SubCount(ElementTypePB typePb)
        {
            switch (typePb)
            {
            case ElementTypePB.Image:
                CurImageCount--;
                break;

            case ElementTypePB.Text:
                CurTextCount--;
                break;

            case ElementTypePB.Racket:
                CurRacketCount--;
                break;
            }
        }
Exemple #5
0
    public HeadFrameVo(ElementPB pb)
    {
        Id            = pb.Id;
        ElementType   = pb.ElementType;
        ElementModule = pb.ElementModule;
        Name          = pb.Name;
        UnlockClaim   = pb.UnlockClaim;
        Desc          = pb.Desc;
        SetIsUnlock();
        Path = "HeadFrame/" + pb.Id;
        Key  = GlobalData.PlayerModel.PlayerVo.UserId + Id + "";
        SetRedDot();

        if (!IsUnlock)
        {
            Sort = 1;
        }
    }
Exemple #6
0
    public void SetShowSelectItem(ElementTypePB elementType)
    {
        _imageList.RefillCells();
        _diaryElementModel.GetElementByType(elementType, ElementModulePB.Diary, ref _unlockElementItemList,
                                            ref _lockElementItemList);
        _toggleSelectGroupBottom.Find("Image/Tips").gameObject.Hide();
        if (elementType == ElementTypePB.Racket)
        {
            _lockElementItemList.Clear();
            if (_unlockElementItemList.Count == 0)
            {
                _toggleSelectGroupBottom.Find("Image/Tips").gameObject.Show();
            }
        }

        _imageList.totalCount = _lockElementItemList.Count + _unlockElementItemList.Count;
        _imageList.RefreshCells();
    }
        /// <summary>
        /// 获取解锁unlockeds和未解锁lockeds的元素
        /// </summary>
        /// <param name="pbType"></param>
        /// <param name="unlockeds"></param>
        /// <param name="lockeds"></param>
        public void GetElementByType(ElementTypePB pbType, ElementModulePB moduleType, ref List <ElementPB> unlockeds,
                                     ref List <ElementPB> lockeds)
        {
            //fen 两个队列返回
            if (unlockeds != null)
            {
                unlockeds.Clear();
            }

            if (lockeds != null)
            {
                lockeds.Clear();
            }

            ElementPB pb;

            for (int i = 0; i < _rules.Count; i++)
            {
                pb = _rules[i];
                if (pb.ElementType != pbType || pb.ElementModule != moduleType)
                {
                    continue;
                }

                if (IsCanUseElement(pb.Id)) //pb.Gem == 0免费
                {
                    if (unlockeds == null)
                    {
                        continue;
                    }
                    unlockeds.Add(pb);
                }
                else
                {
                    if (lockeds == null)
                    {
                        continue;
                    }
                    lockeds.Add(pb);
                }
            }

            return;
        }