コード例 #1
0
        private string GetDescriptionPart(Dictionary <CaseType, string> cases, float value)
        {
            if (cases.Count == 0)
            {
                return(string.Empty);
            }
            CaseType @case = CasesUtil.GetCase((int)value);

            return(!cases.ContainsKey(@case) ? cases[CaseType.DEFAULT] : cases[@case]);
        }
コード例 #2
0
        private string Pluralize(int amount)
        {
            switch (CasesUtil.GetCase(amount))
            {
            case CaseType.DEFAULT:
                return(string.Format(this.containersAmountPlural1Text.Value, amount));

            case CaseType.ONE:
                return(string.Format(this.containersAmountSingularText.Value, amount));

            case CaseType.TWO:
                return(string.Format(this.containersAmountPlural2Text.Value, amount));
            }
            throw new Exception("Invalid case");
        }
コード例 #3
0
 public void ShowPrem(List <Animator> animators, bool premWithQuest, int daysCount, bool promo = false)
 {
     this.premIcon.SetActive(!premWithQuest);
     this.xpremIcon.SetActive(premWithQuest);
     this.days.text = string.Format((string)this.premDays, daysCount, CasesUtil.GetLocalizedCase((string)this.dayLocalizationCases, daysCount));
     if (!promo)
     {
         this.title.text = (string)this.usualPremTitle;
     }
     else
     {
         this.title.text  = (string)this.promoPremTitle;
         this.reason.text = string.Format((string)this.promoPremText, SelfUserComponent.SelfUser.GetComponent <UserUidComponent>().Uid);
         this.reason.gameObject.SetActive(true);
     }
     this.Show(animators);
 }
コード例 #4
0
        private string Pluralize(int amount)
        {
            CaseType @case = CasesUtil.GetCase(amount);

            if (@case == CaseType.DEFAULT)
            {
                return(this.battlesDef.Value);
            }
            if (@case == CaseType.ONE)
            {
                return(this.battlesOne.Value);
            }
            if (@case != CaseType.TWO)
            {
                throw new Exception("ivnalid case");
            }
            return(this.battlesTwo.Value);
        }
コード例 #5
0
        private string Pluralize(int amount)
        {
            CaseType @case = CasesUtil.GetCase(amount);

            if (@case == CaseType.DEFAULT)
            {
                return(string.Format(this._battlesAmountPlural1Text.Value, amount));
            }
            if (@case == CaseType.ONE)
            {
                return(string.Format(this._battlesAmountSingularText.Value, amount));
            }
            if (@case != CaseType.TWO)
            {
                throw new Exception("ivnalid case");
            }
            return(string.Format(this._battlesAmountPlural2Text.Value, amount));
        }
コード例 #6
0
        private string Pluralize(int amount)
        {
            CaseType @case = CasesUtil.GetCase(amount);
            string   str   = "<color=#84F6F6FF>" + amount + "</color>";

            if (@case == CaseType.DEFAULT)
            {
                return(string.Format(this.chargesAmountPlural1Text.Value, str));
            }
            if (@case == CaseType.ONE)
            {
                return(string.Format(this.chargesAmountSingularText.Value, str));
            }
            if (@case != CaseType.TWO)
            {
                throw new Exception("ivnalid case");
            }
            return(string.Format(this.chargesAmountPlural2Text.Value, str));
        }