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]); }
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"); }
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); }
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)); }
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)); }