public override void Update(GameTime gameTime) { base.Update(gameTime); var lastPressedKey = Keyboard.GetState().GetPressedKeys().LastOrDefault(); ShiftMechanics?.HandleEvent(this, new ShiftEventArgs() { GameTime = gameTime, Direction = ShiftingDirection.FromKey(lastPressedKey) }); FallMechanics?.HandleEvent(this, new FallEventArgs() { GameTime = gameTime }); RotateMechanics?.HandleEvent(this, new RotateEventArgs() { GameTime = gameTime, Direction = RotatingDirection.FromKey(lastPressedKey) }); }
public void SetRotatingDirection(MotorSelection motors, RotatingDirection direction) { lock (this) { SendCommand(new byte[] { (byte)RNCommands.SetRotationDirection, (byte)motors, (byte)direction }); } }