Ejemplo n.º 1
0
        //获取下个玩家索引 排序休息玩家索引
        public static int GetNextSeatIndexExcludeRest(this FiveStarRoom fiveStarRoom, int currSeatIndexint, int maxSeatIndex)
        {
            int nextSeat = SeatIndexTool.GetNextSeatIndex(currSeatIndexint, maxSeatIndex);

            if (fiveStarRoom.RoomNumber == 4 && nextSeat == fiveStarRoom.CurrRestSeatIndex)
            {
                nextSeat = SeatIndexTool.GetNextSeatIndex(nextSeat, maxSeatIndex);
            }
            return(nextSeat);
        }
Ejemplo n.º 2
0
        //判断玩家是不是第一手出牌 并广播可以出牌的消息
        public static void CanPlayCard(this JoyLdsRoom joyLdsRoom)
        {
            int  playCardSeatIndex = SeatIndexTool.GetNextSeatIndex(joyLdsRoom.CurrBeOperationSeatIndex, JoyLdsRoom.RoomNumber - 1);
            bool isFirst           = playCardSeatIndex == joyLdsRoom.CurrPlayCardSeatIndex;

            if (isFirst)
            {
                joyLdsRoom.CurrPlayCardType  = PlayCardType.None;
                joyLdsRoom.CurrPlayCardCards = null;
            }
            joyLdsRoom.CanPlayCardBroadcast(playCardSeatIndex, isFirst);
        }
Ejemplo n.º 3
0
 //通知玩家叫地主或者抢地主
 public static void CanCallOrRobLandlord(this JoyLdsRoom joyLdsRoom)
 {
     if (joyLdsRoom.CurrBeOperationSeatIndex < 0)//判断当前有没有人选择叫或抢地主
     {
         //当前选择一个人叫地主
         joyLdsRoom.CanCallLanlord(joyLdsRoom.StartCallLandlordSeatIndex);
         joyLdsRoom.CurrBeOperationSeatIndex = joyLdsRoom.StartCallLandlordSeatIndex;
     }
     else
     {
         if (joyLdsRoom.IsTheEndOnceCallLds) //只有起始玩家第二次选择的时候才会进来
         {
             joyLdsRoom.ConfirmLandlord();   //确定谁是地主
             return;
         }
         joyLdsRoom.CurrBeOperationSeatIndex = SeatIndexTool.GetNextSeatIndex(joyLdsRoom.CurrBeOperationSeatIndex, JoyLdsRoom.RoomNumber - 1); //获取当前选择的下个玩家索引
         if (joyLdsRoom.CurrBeOperationSeatIndex == joyLdsRoom.StartCallLandlordSeatIndex)                                                     //如果下个选择的玩家就是起始玩家 说明已经叫过一轮了
         {
             if (joyLdsRoom.SelectCallOrRobLandlordSeatIndex < 0)
             {
                 joyLdsRoom.AnewDealBroadcast();//小于0表示没有一个人叫过地主
             }
             else
             {
                 if (joyLdsRoom.StartPlayerIsCallLds && joyLdsRoom.SelectCallOrRobLandlordSeatIndex != joyLdsRoom.StartCallLandlordSeatIndex)//如果叫完一轮 最开始玩家也叫地主了 最优先的玩家 不是最开始的玩家 他还可以选择抢不抢
                 {
                     joyLdsRoom.IsTheEndOnceCallLds = true;
                     joyLdsRoom.CanRobLanlordBroadcast(joyLdsRoom.StartCallLandlordSeatIndex);
                     return;
                 }
                 joyLdsRoom.ConfirmLandlord(); //确定谁是地主
             }
             return;
         }
         if (joyLdsRoom.SelectCallOrRobLandlordSeatIndex < 0)
         {
             joyLdsRoom.CanCallLanlord(joyLdsRoom.CurrBeOperationSeatIndex);//如果没人叫地主广播 可以叫地主的消息
         }
         else
         {
             joyLdsRoom.CanRobLanlordBroadcast(joyLdsRoom.CurrBeOperationSeatIndex);//如果有人叫地主广播 可以抢地主的消息
         }
     }
 }