using System.Collections.Generic; using System.Linq; namespace GameFix.Poker { public class DataCardConst { public const byte CardTypeNormal = 1; // 普通牌 public const byte CardTypeLZ = 2; // 癞子牌 public const byte CardTypeMain = 1 << 2; // 主牌 public const byte CardTypeSecond = 1 << 3; // 副牌 /// /// 黑桃 /// public const byte SuitSpade = 1; /// /// 红桃 /// public const byte SuitHeart = 2; /// /// 梅花 /// public const byte SuitClub = 3; /// /// 方块 /// public const byte SuitDiamond = 4; /// /// 王 /// public const byte SuitJoker = 5; /// /// 无牌型 /// public const byte CardStyle0 = 0; /// /// 单张 /// public const byte CardStyle1 = 1; /// /// 对子 /// public const byte CardStyle2 = 2; /// /// 三张 /// public const byte CardStyle3 = 3; /// /// 炸弹 (四张以上) /// public const byte CardStyleBomb = 4; /// /// 火箭 /// public const byte CardStyle5 = 5; /// /// 顺子 /// public const byte CardStyle123 = 6; /// /// 双顺 (3个起) /// public const byte CardStyle112233 = 7; /// /// 三顺 /// public const byte CardStyle111222 = 8; /// /// 三带一 /// public const byte CardStyle31 = 9; /// /// 三带对 /// public const byte CardStyle32 = 10; /// /// 四带两张或者一对 /// public const byte CardStyle41 = 11; /// /// 四带两对 /// public const byte CardStyle42 = 12; /// /// 飞机带单张 /// public const byte CardStyle331 = 13; /// /// 飞机带对子 /// public const byte CardStyle332 = 14; /// /// 双顺 (2个起) /// public const byte CardStyle1122 = 15; /// /// 510K /// public const byte CardStyle510K = 16; /// /// 正510K /// public const byte CardStyle510KPlus = 17; /// /// 三带两张 /// public const byte CardStyle311 = 18; /// /// 飞机带两张 /// public const byte CardStyle3311 = 19; /// /// 带王炸弹 (四张以上) /// public const byte CardStyleJokerBomb = 20; /// /// 甩牌牌型 /// public const byte CardStylePutCards = 21; /// /// 三顺 (3个起) /// public const byte CardStyle111222333 = 22; /// /// 全王炸弹 /// public const byte CardStyleAllJokerBomb = 23; /// /// 连炸 (3连以上) /// public const byte CardStyleBomb123 = 24; /// /// 连炸 (2连以上) /// public const byte CardStyleBomb12 = 25; /// /// 单牌炸弹 /// public const byte CardStyleBomb1 = 26; /// /// 对子炸弹 /// public const byte CardStyleBomb2 = 27; /// /// 多副510K /// public const byte CardStyle510KMult = 28; #region 牌值 public const byte CardValue2 = 16; public const byte CardValue3 = 3; public const byte CardValue5 = 5; public const byte CardValue10 = 10; public const byte CardValueK = 13; public const byte CardValueSmallJoker = 18; public const byte CardValueBigJoker = 19; #endregion // 花色 public static readonly byte[] CardSuits = new byte[] { SuitSpade, SuitHeart, SuitClub, SuitDiamond, }; // A-K public static readonly byte[] CardValues = new byte[] { 14, 16, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; public static readonly string[] CardValueText = new string[] { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" }; // 小王 大王 public static readonly byte[] JokerValues = new byte[] { 18, 19 }; public static readonly Dictionary CardStyleReadableText = new Dictionary() { {CardStyle0, "无牌型" }, {CardStyle1, "单张" }, {CardStyle2, "对子" }, {CardStyle3, "三张" }, {CardStyleBomb, "炸弹" }, {CardStyleJokerBomb, "炸弹" }, {CardStyle5, "火箭" }, {CardStyle31, "三带一" }, {CardStyle311, "三带两张" }, {CardStyle32, "三带二" }, {CardStyle41, "四带两张或者一对" }, {CardStyle42, "四带两对" }, {CardStyle331, "飞机带单张" }, {CardStyle3311, "飞机带两张" }, {CardStyle332, "飞机带对子" }, {CardStyle123, "顺子" }, {CardStyle112233, "双顺" }, {CardStyle111222, "三顺" }, {CardStyle1122, "双顺" }, {CardStyle510K, "副510K" }, {CardStyle510KPlus, "正510K" }, {CardStylePutCards, "甩牌" }, {CardStyleAllJokerBomb, "王炸" }, {CardStyleBomb1, "单牌炸" }, {CardStyleBomb2, "对子炸" }, {CardStyle510KMult, "多510K"} }; public static bool IsJoker(Card card) { return JokerValues.Contains(card.Value); } } }