/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Get the first frame where a rollback is required because the predicted input didn't match /// the confirmed input or a negative value if all predicted inputs match the confirmed inputs. /// </summary> /// <returns>The first frame where the predicted input didn't match the confirmed input.</returns> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public long GetFirstFrameWhereRollbackIsRequired() { for (int i = 0; i < this._buffer.Count; ++i) { FluxPlayerInput input = this._buffer[i]; if (input != null && input.ConfirmedInput != null && !input.ArePredictedAndConfirmedInputsEqual()) { return(this.GetFrame(i)); } } return(-1); }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Initializes a new instance of the <see cref="BUM.InputSystem.PlayerInput"/> class. /// </summary> /// <param name="source">Source.</param> /////////////////////////////////////////////////////////////////////////////////////////////////////////////// public FluxPlayerInput(FluxPlayerInput source) : this(source.PredictedInput, source.ConfirmedInput) { }