Exemplo n.º 1
0
        private void FinalizeTentativeSnapshot()
        {
            var snapshot = _snapshotManager.TentativeSnapshot;

            if (snapshot == null)
            {
                return;
            }

            var tickDiff = this.Tick - snapshot.Tick;

            // Only finalize the tentative snapshot if the level has changed since the update
            if (tickDiff > 1 || _snapshotManager.HasLevelChangedSinceTentative(this))
            {
                _snapshotManager.FinalizeTentativeSnapshot();
                return;
            }

            // The update resulted in no change so undoing it
            this.Tick = snapshot.Tick;
            this.Move = snapshot.Move;
            _snapshotManager.ResetTentativeSnapshot();
        }