示例#1
0
        /// <summary>
        /// 玩家离开座位后事件处理
        /// </summary>
        /// <param name="inningeGame"></param>
        /// <param name="e"></param>
        public virtual void AfterPlayerLeave(object inningeGame, EventArgs e)
        {
            string playerId    = ((PlayerEventArgs)e).Player.Id.ToString();
            var    roomMessage = WebscoketSendObjs.RoomMessage(0, "有玩家离开了");

            NotifyRoomPlayers(roomMessage);
        }
示例#2
0
        /// <summary>
        /// 玩家离开座位后事件处理
        /// </summary>
        /// <param name="inningeGame"></param>
        /// <param name="e"></param>
        public virtual void AfterPlayerLeave(object inningeGame, EventArgs e)
        {
            int playerId    = ((PlayerEventArgs)e).Player.Id;
            var roomMessage = WebscoketSendObjs.RoomMessage(0, "有玩家离开了");

            InningeGame.IRoom.RemovePlayerById(playerId);
            NotifyRoomPlayers(roomMessage);
        }
示例#3
0
        /// <summary>
        /// 检查能不能开始
        /// </summary>
        /// <param name="innineGame_">本局游戏</param>
        /// <returns>YN</returns>
        public virtual bool CheckStart(IInningeGame innineGame_)
        {
            int playerOnSeatCopunt = innineGame_.NotEmptySeats().Count;

            if (playerOnSeatCopunt < innineGame_.IGameProject.PlayerCountLeast || playerOnSeatCopunt > PlayerCountLimit)
            {
                Notify?.Invoke(WebscoketSendObjs.RoomMessage(0, "人数不足,不能启动游戏"));
                return(false);
            }

            return(true);
        }
示例#4
0
 /// <summary>
 /// 重置游戏,以便开始新的一局
 /// </summary>
 public virtual void ResetGame(object inningeGame, EventArgs e)
 {
     NotifyRoomPlayers(WebscoketSendObjs.ResetGame(0));
 }
示例#5
0
 /// <summary>
 /// 游戏正常结束
 /// </summary>
 /// <param name="inningeGame">本局游戏</param>
 /// <param name="e"></param>
 public virtual void GameOver(object inningeGame, EventArgs e)
 {
     NotifyRoomPlayers(WebscoketSendObjs.GameOver(0));
 }
示例#6
0
        /// <summary>
        /// 游戏异常中断
        /// </summary>
        /// <param name="inningeGame">本局游戏</param>
        /// <param name="e"></param>
        public virtual void Stoped(object inningeGame, EventArgs e)
        {
            var myE = (GameStopedEventArgs)e;

            NotifyRoomPlayers(WebscoketSendObjs.Stoped(0, myE.Message));
        }
示例#7
0
        /// <summary>
        /// 玩家坐下后事件处理
        /// </summary>
        /// <param name="inningeGame"></param>
        /// <param name="e"></param>
        public virtual void AfterSitDown(object inningeGame, EventArgs e)
        {
            var roomMessage = WebscoketSendObjs.RoomMessage(0, "有玩家进入");

            NotifyRoomPlayers(roomMessage);
        }
示例#8
0
 /// <summary>
 /// 开始游戏处理事件
 /// </summary>
 /// <param name="sender">IInngineGame</param>
 /// <param name="e"></param>
 public virtual void GameStart(object inngineGame, EventArgs e)
 {
     InningeGame = (IInningeGame)inngineGame;
     NotifyRoomPlayers(WebscoketSendObjs.RoomMessage(0, "游戏开始了!"));
 }
示例#9
0
 /// <summary>
 /// 重置游戏,以便开始新的一局
 /// </summary>
 public virtual void ResetGame(object inningeGame, EventArgs e)
 {
     Notify?.Invoke(WebscoketSendObjs.ResetGame(0));
 }
示例#10
0
 /// <summary>
 /// 游戏正常结束
 /// </summary>
 /// <param name="inningeGame">本局游戏</param>
 /// <param name="e"></param>
 public virtual void GameOver(object inningeGame, EventArgs e)
 {
     Notify?.Invoke(WebscoketSendObjs.GameOver(0));
 }