Example #1
0
        public void TakeHistorySnapshot()
        {
            lock (_history)
            {
                var historyItem = new PlayerHistoryItem();
                historyItem.Time = Player.LastUpdate;

                historyItem.Player = Player.Clone();
                var last = LastInHistory;
                if (last == null)
                {
                    historyItem.PlayerDelta = new Player();
                }
                else
                {
                    historyItem.PlayerDelta = Player - last.Player;
                }
                LastPlayer      = historyItem.Player;
                LastPlayerDelta = historyItem.PlayerDelta;

                _history.Add(historyItem);
            }
        }
Example #2
0
        public void TakeHistorySnapshot()
        {
            lock (_history)
            {
                var historyItem = new PlayerHistoryItem();
                historyItem.Time = Player.LastUpdate;

                historyItem.Player = Player.Clone();
                var last = LastInHistory;
                if (last == null)
                    historyItem.PlayerDelta = new Player();
                else
                {
                    historyItem.PlayerDelta = Player - last.Player;
                }
                LastPlayer = historyItem.Player;
                LastPlayerDelta = historyItem.PlayerDelta;

                _history.Add(historyItem);
            }
        }