棋牌游戏开发-服务器(02) 牌和牌的基本操作

一周又过去了,今天一天差不多都是在床上躺过去了。

下午起床到楼下吃了一碗炸酱面

棋牌游戏开发-服务器(02) 牌和牌的基本操作

然后不知道该干啥,于是就回家打开电脑,开始继续写博客

 

上一篇我们一起完成了早.net core下的websocket的的中间件的开发。

基本的东西算是有了,今天我们来关注一下游戏逻辑的问题

开篇的时候,我们提到过,我们要开发的是一个炸金花的棋牌游戏(没玩过的同学请传送到百度百科https://baike.baidu.com/item/%E7%82%B8%E9%87%91%E8%8A%B1/8806924?fr=aladdin)

首先我们捋一下服务器需要做的东西

定义一副扑克牌的类型

炸金花游戏的牌型

洗牌,生成N家牌

先定义好扑克牌的基本类型

/// <summary> ////// </summary> public class CardType { public static int A_A = 0; public static int B_A = 1; public static int C_A = 2; public static int D_A = 3; public static int A_2 = 4; public static int B_2 = 5; public static int C_2 = 6; public static int D_2 = 7; public static int A_3 = 8; public static int B_3 = 9; public static int C_3 = 10; public static int D_3 = 11; public static int A_4 = 12; public static int B_4 = 13; public static int C_4 = 14; public static int D_4 = 15; public static int A_5 = 16; public static int B_5 = 17; public static int C_5 = 18; public static int D_5 = 19; public static int A_6 = 20; public static int B_6 = 21; public static int C_6 = 22; public static int D_6 = 23; public static int A_7 = 24; public static int B_7 = 25; public static int C_7 = 26; public static int D_7 = 27; public static int A_8 = 28; public static int B_8 = 29; public static int C_8 = 30; public static int D_8 = 31; public static int A_9 = 32; public static int B_9 = 33; public static int C_9 = 34; public static int D_9 = 35; public static int A_10 = 36; public static int B_10 = 37; public static int C_10 = 38; public static int D_10 = 39; public static int A_J = 40; public static int B_J = 41; public static int C_J = 42; public static int D_J = 43; public static int A_Q = 44; public static int B_Q = 45; public static int C_Q = 46; public static int D_Q = 47; public static int A_K = 48; public static int B_K = 49; public static int C_K = 50; public static int D_K = 51; public static int W_XW = 52; public static int W_DW = 53; }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wpdwfz.html