public void Cleanup()
        {
            Snapshot          snapshot          = snapshotFactory.Create();
            DateTime          now               = DateTime.UtcNow;
            uint              lastInputId       = lastInputIdStorage.GetLastInputId();
            float             deltaTimeSec      = Time.deltaTime;
            PredictedSnapshot predictedSnapshot = new PredictedSnapshot(now, lastInputId, deltaTimeSec);

            predictedSnapshot.Modify(snapshot);
            predictedSnapshotsStorage.PutPredicted(predictedSnapshot);
        }
예제 #2
0
        private void ReplaceWrongSnapshot(SnapshotWithLastInputId correctServerSnapshot)
        {
            PredictedSnapshot wrongSnapshot = predictedSnapshotsStorage
                                              .GetByInputId(correctServerSnapshot.lastProcessedInputId);

            //изменение ошибочного снимка
            // ReSharper disable once PossibleNullReferenceException
            wrongSnapshot.Clear();
            wrongSnapshot.Modify(correctServerSnapshot);

            //todo это можно не делать
            predictedSnapshotsStorage.PutCorrect(wrongSnapshot);
        }