Exemple #1
0
    void OnGameResult(int reason)
    {
        if (pvpGame != null)
        {
            pvpGame.Stop();
        }

        if (pvpRoom != null)
        {
            pvpRoom.CancelReady();
        }

        // 重来?
    }
Exemple #2
0
        public void Execute(BaseGame game, long tick)
        {
            if (this.m_tick <= tick)
            {
                PVPGame pvp = game as PVPGame;
                if (pvp != null)
                {
                    switch (game.GameState)
                    {
                    case eGameState.Inited:
                        pvp.Prepare();
                        break;

                    case eGameState.Prepared:
                        pvp.StartLoading();
                        break;

                    case eGameState.Loading:
                        if (pvp.IsAllComplete())
                        {
                            pvp.StartGame();
                        }
                        break;

                    case eGameState.Playing:
                        if ((pvp.CurrentPlayer == null || !pvp.CurrentPlayer.IsAttacking) && pvp.CurrentActionCount == 1)
                        {
                            if (pvp.CanGameOver())
                            {
                                pvp.GameOver();
                            }
                            else
                            {
                                pvp.NextTurn();
                            }
                        }
                        break;

                    case eGameState.GameOver:
                        if (pvp.CurrentActionCount == 1)
                        {
                            pvp.Stop();
                        }
                        break;
                    }
                }
                this.m_isFinished = true;
            }
        }
Exemple #3
0
        /// <summary>
        /// 停止游戏
        /// </summary>
        private void StopGame()
        {
            if (m_game != null)
            {
                m_game.Stop();
                m_game = null;
            }

            if (m_room != null)
            {
                m_room.CancelReady();
            }

            ModuleManager.Instance.SendMessage(ModuleDef.HostModule, "ReStart");
        }