/// <summary> /// Updates the specified game time. /// </summary> /// <param name="gameTime">The game time.</param> /// <param name="currentTouchout">The current touchout.</param> /// <param name="nextState">State of the next.</param> /// <returns></returns> public override bool Update(GameTime gameTime, TouchCollection currentTouchout, out TouchStateBase nextState) { if (this.cooldown > TouchStateMachine.Configuration.CooldownTime) { nextState = new WaitingState(); return(true); } this.cooldown += gameTime.ElapsedGameTime.Milliseconds; nextState = null; return(false); }
public override bool Update(GameTime gameTime, TouchCollection currentTouch, out TouchStateBase nextState) { switch (currentTouch.Count) { case 1: nextState = new DragState(); TouchStateMachine.SubmitGestureEvent(new DragEventArgs(GestureTiming.Started, currentTouch[0].Position)); return(true); case 2: TouchStateMachine.SubmitGestureEvent(new RotateAndScaleEventArgs(GestureTiming.Started, 0, 0)); nextState = new RotateAndScaleState(); return(true); default: // bail because no gesture is active anymore nextState = new WaitingState(); return(true); } }