public ContentAddedToProduct(Guid productId, string title, string description, AttributeRef slicerAttribute)
 {
     ProductId       = productId;
     Title           = title;
     Description     = description;
     SlicerAttribute = slicerAttribute;
 }
 public VariantAddedToProduct(Guid productId, string barcode, AttributeRef slicerAttribute, AttributeRef varianterAttribute)
 {
     ProductId          = productId;
     Barcode            = barcode;
     SlicerAttribute    = slicerAttribute;
     VarianterAttribute = varianterAttribute;
 }
Example #3
0
    void ShowChild()
    {
        if (curData == null)
        {
            return;
        }
        CopyRef refd = ConfigMng.Instance.GetCopyRef(curData.copy[Index]);

        if (refd == null)
        {
            return;
        }
        if (curName != null)
        {
            curName.spriteName = refd.Icon;
        }
        if (childCurName != null)
        {
            childCurName.spriteName = refd.Icon;
        }
        for (int i = 0; i < uifx.Length; i++)
        {
            if (uifx[i] == null)
            {
                continue;
            }
            if (i == Index)
            {
                uifx[i].SetActive(true);
            }
            else
            {
                uifx[i].SetActive(false);
            }
        }
        AttributeRef attributeRef = ConfigMng.Instance.GetAttributeRef(refd.lvId > 0 ? refd.lvId : 1);

        if (attributeRef.reborn > 0)
        {
            if (lev != null)
            {
                lev.text = ConfigMng.Instance.GetUItext(12, new string[2] {
                    attributeRef.reborn.ToString(), attributeRef.display_level.ToString()
                });
            }
        }
        else
        {
            if (lev != null)
            {
                lev.text = ConfigMng.Instance.GetUItext(13, new string[1] {
                    attributeRef.display_level.ToString()
                });
            }
        }
        if (fight != null)
        {
            fight.text = refd.fighting.ToString();
        }
    }
Example #4
0
    void Show()
    {
        if (name != null)
        {
            name.text = data.name;
        }
        if (des != null)
        {
            des.text = data.typeres.Replace("\\n", "\n");
        }
        if (icon != null)
        {
            icon.spriteName = data.icon;
            icon.MakePixelPerfect();
            UIButton btn = gameObject.GetComponent <UIButton>();
            if (btn != null)
            {
                btn.normalSprite = data.icon;
            }
        }
        if (SerVerData == null)
        {
            return;
        }
        if (lev != null)
        {
            AttributeRef attributeRef = ConfigMng.Instance.GetAttributeRef(data.level == 0 ? 1 : data.level);
            if (attributeRef.reborn > 0)
            {
                lev.text = ConfigMng.Instance.GetUItext(12, new string[2] {
                    attributeRef.reborn.ToString(), attributeRef.display_level.ToString()
                });
            }
            else
            {
                lev.text = ConfigMng.Instance.GetUItext(13, new string[1] {
                    attributeRef.display_level.ToString()
                });
            }
            lev.color = SerVerData.ActivityLev ? Color.white : Color.red;
        }
        int times = SerVerData.Times;

        if (num != null)
        {
            num.text = SerVerData.Num + "/" + times;
        }
        if (numDes != null)
        {
            numDes.enabled = times == 0;
        }
        if (num != null)
        {
            num.enabled = times != 0;
        }
    }
        public void Given_Product_Has_Same_Attribute_Then_Business_Exception_Should_Be_Thrown()
        {
            var anAttribute = new AttributeRef(Random <int>(), Random <int>());

            ScenarioForExisting()
            .Given(
                () =>
            {
                var aggregate = Product.Create(Random <Guid>(), Random <int>(), Random <int>(), Random <string>());
                aggregate.AddContent(Random <string>(), Random <string>(), anAttribute);
                return(aggregate);
            })
            .When(
                product => product.AddContent(Random <string>(), Random <string>(), anAttribute)
                )
            .ThenThrows <BusinessException>("Same content already exists with given attribute");
        }
Example #6
0
    void OnEnable()
    {
        myToggle = GetComponent <UIToggle>();
        CopyRef refd = ConfigMng.Instance.GetCopyRef(CopyRefID);

        if (refd == null)
        {
            return;
        }
        bool isShow = refd.lvId <= GameCenter.mainPlayerMng.MainPlayerInfo.CurLevel;

        if (name != null)
        {
            name.text  = refd.difficulty;
            name.color = isShow ? color : Color.gray;
        }
        if (bgSp != null)
        {
            bgSp.IsGray = isShow ? UISpriteEx.ColorGray.normal : UISpriteEx.ColorGray.Gray;
        }
        gameObject.GetComponent <BoxCollider>().enabled = isShow;
        AttributeRef attributeRef = ConfigMng.Instance.GetAttributeRef(refd.lvId);

        if (attributeRef.reborn > 0)
        {
            if (lev != null)
            {
                lev.text = ConfigMng.Instance.GetUItext(10, new string[2] {
                    attributeRef.reborn.ToString(), attributeRef.display_level.ToString()
                });
            }
        }
        else
        {
            if (lev != null)
            {
                lev.text = ConfigMng.Instance.GetUItext(11, new string[1] {
                    attributeRef.display_level.ToString()
                });
            }
        }
        if (lev != null)
        {
            lev.color = isShow ? color : Color.gray;
        }
    }
Example #7
0
    public static string GetLevelStr(int _level)
    {
        AttributeRef attributeRef = ConfigMng.Instance.GetAttributeRef(_level > 0 ? _level : 1);

        if (attributeRef.reborn > 0)
        {
            return(ConfigMng.Instance.GetUItext(12, new string[2] {
                attributeRef.reborn.ToString(), attributeRef.display_level.ToString()
            }));
        }
        else
        {
            return(ConfigMng.Instance.GetUItext(13, new string[1] {
                attributeRef.display_level.ToString()
            }));
        }
        //return "";
    }
        public void Given_Product_Has_No_Image_Business_Exception_Should_Be_Thrown()
        {
            var productId = Random <Guid>();

            ScenarioForExisting()
            .Given(
                () =>
            {
                var aggregate       = Product.Create(productId, Random <int>(), Random <int>(), Random <string>());
                var slicerAttribute = new AttributeRef(Random <int>(), Random <int>());
                aggregate.AddContent(Random <string>(), Random <string>(), slicerAttribute);
                aggregate.AddVariant(Random <string>(), slicerAttribute,
                                     new AttributeRef(Random <int>(), Random <int>()));
                return(aggregate);
            })
            .When(
                product => product.Approve())
            .ThenThrows <BusinessException>("Product must have at least one image");
        }
        public void Product_Should_Be_Approved()
        {
            var productId = Random <Guid>();
            var @event    = new ProductApproved(productId);

            ScenarioForExisting()
            .Given(
                () =>
            {
                var aggregate       = Product.Create(productId, Random <int>(), Random <int>(), Random <string>());
                var slicerAttribute = new AttributeRef(Random <int>(), Random <int>());
                aggregate.AddContent(Random <string>(), Random <string>(), slicerAttribute);
                var varianterAttribute = new AttributeRef(Random <int>(), Random <int>());
                aggregate.AddVariant(Random <string>(), slicerAttribute, varianterAttribute);
                aggregate.AssignImage(Random <ImageRef>(), varianterAttribute);
                return(aggregate);
            })
            .When(
                product => product.Approve())
            .Then(@event)
            .AlsoAssert(product => product.IsApproved);
        }
Example #10
0
 public AttributeAddedToProduct(Guid productId, AttributeRef attribute)
 {
     ProductId = productId;
     Attribute = attribute;
 }
Example #11
0
    void ShowPetInfo()
    {
        if (labPetName != null)
        {
            labPetName.text = curTargetInfo.CurPetInfo == null?ConfigMng.Instance.GetUItext(332) : curTargetInfo.CurPetInfo.PetName;
        }
        if (curTargetInfo.CurPetInfo == null)
        {
            ShowNoPet();
            return;
        }
        AttributeRef attributeRef = ConfigMng.Instance.GetAttributeRef((int)curTargetInfo.Level);

        if (attributeRef.reborn > 0)
        {
            if (labPetLv != null)
            {
                labPetLv.text = attributeRef.display_level.ToString();
            }
        }
        else
        {
            if (labPetLv != null)
            {
                labPetLv.text = curTargetInfo.Level.ToString();
            }
        }
        //if(labPetLv != null)labPetLv.text = curTargetInfo.Level.ToString();
        if (labGrowth != null)
        {
            labGrowth.text = curTargetInfo.CurPetInfo.GrowUp.ToString();
        }
        if (labPetValue != null)
        {
            labPetValue.text = curTargetInfo.CurPetInfo.Power.ToString();
        }
        if (labQuality != null)
        {
            labQuality.text = curTargetInfo.CurPetInfo.Aptitude.ToString();
        }
        if (petTexture != null)
        {
            GameCenter.previewManager.TryPreviewSingelEntourage(curTargetInfo.CurPetInfo, petTexture);
        }
        ShowSkill();
        if (singleSkill != null)
        {
            singleSkill.gameObject.SetActive(false);
        }
        if (tianHunStarList.Length > 0)
        {
            ShowStar(tianHunStarList, curTargetInfo.CurPetInfo.Tian_soul);
        }
        if (diHunStarList.Length > 0)
        {
            ShowStar(diHunStarList, curTargetInfo.CurPetInfo.Di_soul);
        }
        if (mingHunStarList.Length > 0)
        {
            ShowStar(mingHunStarList, curTargetInfo.CurPetInfo.Life_soul);
        }
        if (propertyInfoVal.Length >= 9)
        {
            ShowPropertyVal(propertyInfoVal[0], propertyInfoVal[1], propertyInfoVal[2], curTargetInfo.CurPetInfo.PropertyList);
            ShowPropertyVal(propertyInfoVal[3], propertyInfoVal[4], propertyInfoVal[5], curTargetInfo.CurPetInfo.GrowUpPropertyList);
            ShowPropertyVal(propertyInfoVal[6], propertyInfoVal[7], propertyInfoVal[8], curTargetInfo.CurPetInfo.SoulPropertyList);
        }
    }
 public ImageAddedToProduct(Guid productId, AttributeRef varianterAttr, ImageRef image)
 {
     ProductId     = productId;
     VarianterAttr = varianterAttr;
     Image         = image;
 }
Example #13
0
    void ShowData()
    {
        if (noPlayer != null)
        {
            noPlayer.SetActive(teamData == null);
        }
        if (inPlayer != null)
        {
            inPlayer.SetActive(teamData != null);
        }
        //btnToAvatar.SetActive(GameCenter.teamMng.isLeader);
        if (btnToAvatar != null)
        {
            btnToAvatar.SetActive(GameCenter.teamMng.isLeader);
        }
        //if (btnToTeamFri != null) btnToTeamFri.SetActive(GameCenter.teamMng.isLeader && data.IsMagic);

        if (teamData == null)
        {
            return;
        }
        int uid = (int)teamData.baseInfo.uid;

        if (isLeader != null)
        {
            isLeader.SetActive(GameCenter.teamMng.isLeader && uid == GameCenter.teamMng.LeaderId);
        }
        if (pIcon != null)
        {
            pIcon.spriteName = ConfigMng.Instance.GetPlayerConfig((int)teamData.baseInfo.prof).icon_half;
            pIcon.MakePixelPerfect();
        }

        AttributeRef attData = ConfigMng.Instance.GetAttributeRef((int)teamData.baseInfo.lev);

        if (attData.reborn > 0 && pLev != null)
        {
            pLev.text = ConfigMng.Instance.GetUItext(12, new string[2] {
                attData.reborn.ToString(), attData.display_level.ToString()
            });
        }
        else
        {
            pLev.text = ConfigMng.Instance.GetUItext(13, new string[1] {
                attData.display_level.ToString()
            });
        }

        if (pfight != null)
        {
            pfight.text = teamData.baseInfo.fighting.ToString();
        }
        if (name != null)
        {
            name.text = teamData.baseInfo.name;
        }
        int num = 0;

        if (GameCenter.duplicateMng.CopyTeams.ContainsKey(uid))
        {
            num = GameCenter.duplicateMng.CopyTeams[uid].pNum;
            if (pNum != null)
            {
                pNum.text = num.ToString();
            }
            if (pNum != null)
            {
                pNum.transform.parent.gameObject.SetActive(!isAvatar.activeSelf && GameCenter.duplicateMng.CopyType < DuplicateMng.CopysType.MAGICTOWER);
            }
            SetPerpare();
        }

        if (isTeamlShow != null)
        {
            isTeamlShow.SetActive(GameCenter.teamMng.isLeader);
        }
        if (btnOutTeam != null)
        {
            btnOutTeam.SetActive(GameCenter.teamMng.isLeader && uid == GameCenter.teamMng.LeaderId);
        }
        if (btnOtherOut != null)
        {
            btnOtherOut.SetActive(GameCenter.teamMng.isLeader && uid != GameCenter.teamMng.LeaderId);
        }
        //btnToAvatar.SetActive(GameCenter.teamMng.isLeader);
        if (btnToAvatar != null)
        {
            btnToAvatar.SetActive(GameCenter.teamMng.isLeader);
        }
        //if (btnToTeamFri != null) btnToTeamFri.SetActive(GameCenter.teamMng.isLeader && data.IsMagic);
    }
Example #14
0
    void ReinShow(ActorBaseTag tag, ulong y, bool da)
    {
        AttributeRef refData = ConfigMng.Instance.GetAttributeRef(MainInfo.CurLevel);

        if (refData == null)
        {
            return;
        }
        curReinNum.text = refData.reborn + ConfigMng.Instance.GetUItext(360) + " → " + (refData.reborn + 1) + ConfigMng.Instance.GetUItext(360);

        SuperLifeRef data  = ConfigMng.Instance.GetSuperLifeRef(refData.reborn);
        SuperLifeRef datar = ConfigMng.Instance.GetSuperLifeRef(refData.reborn + 1);
        float        posy  = -128;
        float        val   = 0;

        if (datar != null)
        {
            val = MainInfo.ReliveRes;
            if (data != null && data.superExp != 0)
            {
                posy = -126 + (val / data.superExp >= 1 ? 1 : val / data.superExp) * 134;
            }
            reinEx.IsGray = UISpriteEx.ColorGray.normal;
            fullLev.gameObject.SetActive(false);
            rLev.text  = ConfigMng.Instance.GetLevelDes(data.need_lev);
            rLev.color = data.need_lev > MainInfo.CurLevel ? Color.red : Color.white;
            curRein.SetContent(data);
            nextRein.SetContent(data, datar);
            nextRein.gameObject.SetActive(true);
            rExp.text = data.superExp + "/" + (data.superExp > MainInfo.ReliveRes ? "[ff0000]" + MainInfo.ReliveRes + "[-]" : MainInfo.ReliveRes.ToString());
            xiuweiTex.transform.localPosition = new Vector3(xiuweiTex.transform.localPosition.x, posy, 0);
            expItem.FillInfo(new EquipmentInfo(3, GameCenter.inventoryMng.GetNumberByType(3), EquipmentBelongTo.PREVIEW));//经验
            fullLevEffect.SetActive(val / data.superExp >= 1);
            if (expItem.itemName != null)
            {
                expItem.itemName.enabled = false;
            }
        }
        else
        {
            curRein.SetContent(data);
            nextRein.SetContent(data);
            fullLev.gameObject.SetActive(true);
            rLev.gameObject.SetActive(false);
            rExp.gameObject.SetActive(false);
            reinEx.IsGray = UISpriteEx.ColorGray.Gray;
            fullLevEffect.SetActive(false);
        }

        //curExp.text = MainInfo.CurExp.ToString();
        //curFix.text = MainInfo.ReliveRes.ToString();
        if (data != null)
        {
            string needexp = data.needExp.ToString();
            if (data.needExp / 10000 > 1)
            {
                needexp = ((float)data.needExp / 10000) + "万";
            }
            proExp.text = needexp;
            proFix.text = "+" + data.buySuperExp;
            //coins.text = data.needGold.ToString();
//			MallRef mall = null;
            for (int i = 0, len = items.Length; i < len; i++)
            {
                if (items[i] != null && data.items.Count > i)
                {
//					mall = ConfigMng.Instance.GetMallRef(datar.items[i]);
//					if(mall != null){
                    EquipmentInfo Iteminfo = new EquipmentInfo(data.items[i], GameCenter.inventoryMng.GetNumberByType(data.items[i]), EquipmentBelongTo.PREVIEW);
                    items[i].FillInfo(Iteminfo);
                    //itemsCoin[i].text = Iteminfo.DiamondPrice.ToString();
                    if (items[i].itemName != null)
                    {
                        items[i].itemName.enabled = false;
                    }
                    if (GameCenter.inventoryMng.GetNumberByType(data.items[i]) <= 0)
                    {
                        items[i].itemCount.gameObject.SetActive(true);
                        if (items[i].itemCount != null)
                        {
                            items[i].itemCount.text = "0";
                        }
                    }
//					}
                }
            }
        }
        else
        {
            proExp.text = "0";
            proFix.text = "+0";
            //coins.text = "0";
        }
        curNum.text = MainInfo.reinNum.ToString();
    }
Example #15
0
    protected override void OnOpen()
    {
        base.OnOpen();
        AttributeRef refData = ConfigMng.Instance.GetAttributeRef(MainInfo.CurLevel);

        if (refData == null)
        {
            return;
        }
        SuperLifeRef datar = ConfigMng.Instance.GetSuperLifeRef(refData.reborn);

        UIEventListener.Get(btnOne.gameObject).onClick = delegate {
            if (datar.items.Count > 0)
            {
                if (GameCenter.inventoryMng.GetNumberByType(datar.items[0]) > 0)//有普通神元丹直接使用
                {
                    GameCenter.mainPlayerMng.C2S_ReinState(2);
                }
                else //没有神元丹购买神元丹并使用
                {
                    EquipmentInfo Iteminfo = new EquipmentInfo(datar.items[0], 1, EquipmentBelongTo.PREVIEW);
                    if (Iteminfo.DiamondPrice > GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount)
                    {
                        MessageST mst = new MessageST();
                        mst.messID = 137;
                        mst.delYes = delegate
                        {
                            GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE);
                        };
                        GameCenter.messageMng.AddClientMsg(mst);
                    }
                    else
                    {
                        if (!GameCenter.mainPlayerMng.ShowUseNormalGoldPillTip)
                        {
                            GameCenter.mainPlayerMng.C2S_ReinState(2);
                        }
                        else
                        {
                            MessageST mst = new MessageST();
                            object[]  pa  = { 1 };
                            mst.pars    = pa;
                            mst.delPars = delegate(object[] ob)
                            {
                                if (ob.Length > 0)
                                {
                                    bool b = (bool)ob[0];
                                    if (b)
                                    {
                                        GameCenter.mainPlayerMng.ShowUseNormalGoldPillTip = false;
                                    }
                                }
                            };
                            mst.messID = 494;
                            mst.words  = new string[2] {
                                Iteminfo.DiamondPrice.ToString(), Iteminfo.ItemName
                            };
                            mst.delYes = delegate
                            {
                                GameCenter.mainPlayerMng.C2S_ReinState(2);
                            };
                            GameCenter.messageMng.AddClientMsg(mst);
                        }
                    }
                }
            }
        };
        UIEventListener.Get(btnTwo.gameObject).onClick = delegate {
            if (datar.items.Count > 1)
            {
                if (GameCenter.inventoryMng.GetNumberByType(datar.items[1]) > 0)//有普通神元丹直接使用
                {
                    GameCenter.mainPlayerMng.C2S_ReinState(3);
                }
                else //没有神元丹购买神元丹并使用
                {
                    EquipmentInfo Iteminfo = new EquipmentInfo(datar.items[1], 1, EquipmentBelongTo.PREVIEW);
                    if (Iteminfo.DiamondPrice > GameCenter.mainPlayerMng.MainPlayerInfo.TotalDiamondCount)
                    {
                        MessageST mst = new MessageST();
                        mst.messID = 137;
                        mst.delYes = delegate
                        {
                            GameCenter.uIMng.SwitchToUI(GUIType.RECHARGE);
                        };
                        GameCenter.messageMng.AddClientMsg(mst);
                    }
                    else
                    {
                        if (!GameCenter.mainPlayerMng.ShowUseSeniorGoldPillTip)
                        {
                            GameCenter.mainPlayerMng.C2S_ReinState(3);
                        }
                        else
                        {
                            MessageST mst = new MessageST();
                            object[]  pa  = { 1 };
                            mst.pars    = pa;
                            mst.delPars = delegate(object[] ob)
                            {
                                if (ob.Length > 0)
                                {
                                    bool b = (bool)ob[0];
                                    if (b)
                                    {
                                        GameCenter.mainPlayerMng.ShowUseSeniorGoldPillTip = false;
                                    }
                                }
                            };
                            mst.messID = 494;
                            mst.words  = new string[2] {
                                Iteminfo.DiamondPrice.ToString(), Iteminfo.ItemName
                            };
                            mst.delYes = delegate
                            {
                                GameCenter.mainPlayerMng.C2S_ReinState(3);
                            };
                            GameCenter.messageMng.AddClientMsg(mst);
                        }
                    }
                }
            }
        };
        UIEventListener.Get(btnOK.gameObject).onClick = delegate {
            if (datar.superExp > MainInfo.ReliveRes)
            {
                GameCenter.messageMng.AddClientMsg(203);
                return;
            }
            GameCenter.mainPlayerMng.C2S_ReinState(1);
        };
        UIEventListener.Get(btnFix.gameObject).onClick = delegate {
            if (datar == null)
            {
                GameCenter.messageMng.AddClientMsg(220);
                return;
            }
            //if(MainInfo.reinNum <= 0){
            //    GameCenter.messageMng.AddClientMsg(206);
            //    return ;
            //}
            if (MainInfo.CurExp < (ulong)datar.needExp)
            {
                GameCenter.messageMng.AddClientMsg(205);
                return;
            }
            GameCenter.mainPlayerMng.C2S_ReinState(4);
        };
        //UIEventListener.Get(btnRein.gameObject).onClick = delegate {
        //    if(datar == null){
        //        GameCenter.messageMng.AddClientMsg(220);
        //        return ;
        //    }
        //    target.SetActive(true);
        //};
        ReinShow(ActorBaseTag.CurMP, 1, false);
        MainInfo.OnBaseUpdate += ReinShow;
        GameCenter.inventoryMng.OnBackpackUpdate += Refresh;
    }