当前位置: 首页>>代码示例>>C#>>正文


C# GameManager.beginningOfSessionActions方法代码示例

本文整理汇总了C#中GameManager.beginningOfSessionActions方法的典型用法代码示例。如果您正苦于以下问题:C# GameManager.beginningOfSessionActions方法的具体用法?C# GameManager.beginningOfSessionActions怎么用?C# GameManager.beginningOfSessionActions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameManager的用法示例。


在下文中一共展示了GameManager.beginningOfSessionActions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: receiveMessage


//.........这里部分代码省略.........
                    }
                    else
                    */
                    {

                        //Increase the number of ready players
                        // numOfReadyPlayers++;

                        //inform all that the player is ready
                        // host.sendMessageToAll("#" + nickname + " is ready.");

                        //if all players are ready, then initialise the GameManager
                        if (players.Exists(x => x.isReady == false) == false)
                        {
                            //Do not accept any more players
                            host.acceptClient = false;

                            logger.Info("All players have hit Ready.  Game is starting now with {0} AI players", players.Where(x => x.isAI == true).Count());

                            gameManager = new GameManager(this, players);

                            //S[n], n = number of players in this game

                            string strCreateUIMsg = string.Format("StrtGame&PlayerCount={0}&PlayerNames=", gameManager.player.Count);

                            foreach (Player p in gameManager.player.Values)
                            {
                                strCreateUIMsg += string.Format("{0},", p.nickname);
                            }

                            SendMessageToAll(strCreateUIMsg.TrimEnd(','));

                            //set up the game, send information on boards to players, etc.
                            gameManager.beginningOfSessionActions();

                            //set the number of countdowns finished
                            //numOfCountdownsFinished = 0;
                            gameManager.updateAllGameUI();
                        }
                    }
                }
                //m: game mode options
                //changed by TableUI
                else if (message.StartsWith("Expansion"))
                {
                    string whichExpansion = message.Substring(10);

                    if (whichExpansion.StartsWith("Leaders"))
                    {
                        leadersEnabled = whichExpansion.Substring(8) == "True";
                        host.sendMessageToAll(string.Format("ChngMode&Leaders={0}", leadersEnabled));
                    }
                    else if (whichExpansion.StartsWith("Cities"))
                    {
                        citiesEnabled = whichExpansion.Substring(7) == "True";
                        host.sendMessageToAll(string.Format("ChngMode&Cities={0}", citiesEnabled));
                    }
                }
            #if FALSE
                //r: all player's countdowns are
                //tell the GameManager to update each player's game UI
                else if (message[0] == 'r')
                {
                    //increase the number of players with countdowns finished
                    numOfCountdownsFinished++;
                    //everyone's countdown is finished
开发者ID:JamesFairweather,项目名称:7-Wonders-Leaders,代码行数:67,代码来源:GMCoordinator.cs


注:本文中的GameManager.beginningOfSessionActions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。