private BaseAction CreateAction(XmlReader reader, FulFillable lastToDoAble) { BaseAction action = null; var attributes = GetAttributes(reader); var actionName = attributes["name"]; int repititions = 1; if (attributes.ContainsKey("repititions")) { repititions = int.Parse(attributes["repititions"]); } if (actionName == "hold") { action = new HoldAction(actionName, DB.StatisticType.action, null, double.Parse(attributes["value"]), lastToDoAble, settingsManager, feedback, PitchType.pitchDefault, repititions, statisticManager); } else if (actionName == "wait") { action = new WaitAction(actionName, DB.StatisticType.action, null, double.Parse(attributes["value"]), lastToDoAble, settingsManager, feedback, PitchType.pitchDefault, repititions, statisticManager); } if (lastToDoAble != null) { lastToDoAble.AddNext(action); } return(action); }
public void Update(ButtonState state, InputKey inputKey, FrameDetails frame) { if (state.IsPressed) { if (isPressed) { // Down -> down holdDuration += frame.TimeDelta; if (!holdHandled && holdDuration >= Configuration.Duration) { HoldAction.Execute(); holdHandled = true; } } else { // Up -> down holdDuration = 0d; isPressed = true; } } else { if (isPressed) { // Down -> up if (holdDuration < Configuration.Duration) { PressAction.Execute(); } holdHandled = false; isPressed = false; } holdDuration = 0d; } }
/// <summary> /// Lets the game respond to player input. Unlike the Update method, /// this will only be called when the gameplay screen is active. /// </summary> public override void HandleInput(GameTime gameTime, InputState input) { if (input == null) { throw new ArgumentNullException("input"); } // Look up inputs for the active player int activePlayerIndex = (int)ControllingPlayer.Value; KeyboardState keyboardState = input.CurrentKeyboardStates[activePlayerIndex]; PlayerIndex playerIndex; // Pause the game if user presses the pause key if (PauseAction.Evaluate(input, ControllingPlayer, out playerIndex)) { ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer); } if (Player.HasShape) { PlayerRotated = false; // Move left if (MoveLeftAction.Evaluate(input, ControllingPlayer, out playerIndex)) { Player.Shape.Move(Direction.Left); } // Move right if (MoveRightAction.Evaluate(input, ControllingPlayer, out playerIndex)) { Player.Shape.Move(Direction.Right); } // Rotate left if (RotateLeftAction.Evaluate(input, ControllingPlayer, out playerIndex)) { Player.Shape.Rotate(Direction.Left); PlayerRotated = true; } // Rotate right if (RotateRightAction.Evaluate(input, ControllingPlayer, out playerIndex)) { Player.Shape.Rotate(Direction.Right); PlayerRotated = true; } // Soft drop if (SoftDropAction.Evaluate(input, ControllingPlayer, out playerIndex)) { Player.Shape.Move(Direction.Down); } // Hard drop if (HardDropAction.Evaluate(input, ControllingPlayer, out playerIndex)) { int distance = Player.Drop(); } // Hold shape if (HoldAction.Evaluate(input, ControllingPlayer, out playerIndex)) { Player.Hold(); } } }
internal static PsHoldContentAction FromEngineAction(HoldAction action) { return(new PsHoldContentAction(action.HoldDurationDays, action.HoldDurationDisplayHint)); }
// Token: 0x06000173 RID: 371 RVA: 0x0000A370 File Offset: 0x00008570 private static bool CallSetHoldOnMailboxes(ExchangeService service, string searchId, HoldAction holdAction, string query, string inplaceHoldIdentity, string itemHoldPeriod = null) { bool result = true; ServiceResponse serviceResponse = service.SetHoldOnMailboxes(searchId, holdAction, query, inplaceHoldIdentity, itemHoldPeriod); if (serviceResponse.Result == 2) { result = false; SearchEventLogger.Instance.LogSingleFailureSyncDiscoveryHoldToExchangeOnlineEvent(searchId, holdAction.ToString(), query, inplaceHoldIdentity, serviceResponse.ErrorCode.ToString(), serviceResponse.ErrorMessage); } return(result); }