Пример #1
0
        public void Patch(GameStateView newGameStateView)
        {
            Players  = newGameStateView.Players;
            Ghosts   = newGameStateView.Ghosts;
            Coins    = newGameStateView.Coins;
            Walls    = newGameStateView.Walls;
            Servers  = newGameStateView.Servers;
            RoundId  = newGameStateView.RoundId;
            GameOver = newGameStateView.GameOver;

            if (RoundId >= 0 && !PreviousGames.ContainsKey(RoundId))
            {
                PreviousGames.Add(RoundId, WriteState());
            }
        }
Пример #2
0
        private void DispatchState()
        {
            lock (dispatchDestinationLock)
            {
                if (stateDispatchDestinations.Count == 0)
                {
                    return;
                }

                GameStateView gameStateView = gameState.GetGameStateView();
                foreach (string Url in stateDispatchDestinations)
                {
                    outManager.SendCommand(new Command
                    {
                        Type = CommandType.State,
                        Args = gameStateView
                    }, Url);
                }

                stateDispatchDestinations.Clear();
            }
        }