Пример #1
0
        private void GamePlay()
        {
            Task gameLoop = new Task(() => {
                while (true)
                {
                    System.Threading.Thread.Sleep(gameTick);
                    try
                    {
                        var gameList = ProcessPool.Select(b => b.Value).ToList();
                        var count    = gameList.Count;
                        for (var i = 0; i < count; i++)
                        {
                            if (gameList[i].Room.Players.Count <= 0)
                            {
                                continue;
                            }
                            gameList[i].NextTick();
                        }
                    }
                    catch { }
                }
            });

            gameLoop.Start();
        }