/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Gets the state of the game at the specified frame. /// </summary> /// <returns>The state.</returns> /// <param name="frame">Frame.</param> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public bool TryGetState(long frame, out FluxStates state) { KeyValuePair <FluxStates, FluxFrameInput> pair; bool result = this.TryGetStateAndInput(frame, out pair); state = pair.Key; return(result); }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Sets the state of the game at the specified frame. /// </summary> /// <returns>Whether the state could be set successfully.</returns> /// <param name="frame">Frame.</param> /// <param name="state">The state.</param> /// <param name="input">The input that was applied to the specified state to get the next state.</param> /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public bool TrySetState(FluxStates state, FluxFrameInput input) { return(this.TrySetState(new KeyValuePair <FluxStates, FluxFrameInput>(state, input))); }
public FluxSimpleState(FluxStates state) { this.p1 = new PlayerInformation((float)state.player1.life, (float)state.player1.gauge, state.player1.shellTransform.position); this.p2 = new PlayerInformation((float)state.player2.life, (float)state.player2.gauge, state.player2.shellTransform.position); this.frame = state.networkFrame; }