Пример #1
0
        private static void FormatName(CardFormatInfo cardFormatInfo,
            int i,
            StringBuilder sb,
            int rankIndex,
            int suitIndex)
        {
            if (i != 0)
            {
                sb.Append(cardFormatInfo.CardNamesSeparator);
            }

            sb.Append((cardFormatInfo.FormatSettings & CardFormatSettings.UseSuitFirst) == CardFormatSettings.None
                ? cardFormatInfo.GetRankName(rankIndex)
                : cardFormatInfo.GetSuitName(suitIndex,
                    (cardFormatInfo.FormatSettings & CardFormatSettings.UseGenitiveSuit) != CardFormatSettings.None));
            sb.Append(cardFormatInfo.CardNamePartsSeparator);
            sb.Append((cardFormatInfo.FormatSettings & CardFormatSettings.UseSuitFirst) == CardFormatSettings.None
                ? cardFormatInfo.GetSuitName(suitIndex,
                    (cardFormatInfo.FormatSettings & CardFormatSettings.UseGenitiveSuit) != CardFormatSettings.None)
                : cardFormatInfo.GetRankName(rankIndex));
        }
Пример #2
0
        private static void FormatName2(CardFormatInfo cardFormatInfo,
            int i,
            StringBuilder sb,
            char patternChar,
            int rankIndex,
            int suitIndex,
            int num1)
        {
            if (i != 0)
            {
                sb.Append(cardFormatInfo.CardNamesSeparator);
            }

            sb.Append(patternChar == 'R'
                ? cardFormatInfo.GetRankName(rankIndex)
                : cardFormatInfo.GetSuitName(suitIndex,
                    (cardFormatInfo.FormatSettings & CardFormatSettings.UseGenitiveSuit) != CardFormatSettings.None));

            if (num1 != 2)
            {
                return;
            }

            sb.Append(cardFormatInfo.CardNamePartsSeparator);
            sb.Append(patternChar == 'R'
                ? cardFormatInfo.GetSuitName(suitIndex,
                    (cardFormatInfo.FormatSettings & CardFormatSettings.UseGenitiveSuit) != CardFormatSettings.None)
                : cardFormatInfo.GetRankName(rankIndex));
        }