private void CreateKeyboardMappings(KeyboardManager keyManager, Dictionary <PlayerControls, Keys> keyMap, FourWayDirection fourwayDirection) { keyManager.AddMovingActions(new Dictionary <IEnumerable <Keys>, Action> { { new [] { keyMap[PlayerControls.Up] }, () => fourwayDirection.SetDirection(FourDirections.Up) }, { new [] { keyMap[PlayerControls.Down] }, () => fourwayDirection.SetDirection(FourDirections.Down) }, { new [] { keyMap[PlayerControls.Left] }, () => fourwayDirection.SetDirection(FourDirections.Left) }, { new [] { keyMap[PlayerControls.Right] }, () => fourwayDirection.SetDirection(FourDirections.Right) }, }, () => fourwayDirection.SetDirection(FourDirections.Stopped)); }
public static void CreateKeyboardMappings(KeyboardManager manager, Dictionary <PlayerControls, Keys> keyMap, Rotator rotator) { manager.AddMovingActions(new Dictionary <IEnumerable <Keys>, Action> { { new[] { keyMap[PlayerControls.Up], keyMap[PlayerControls.Right] }, () => { rotator.SetDestinationAngle(45f); } }, { new[] { keyMap[PlayerControls.Up], keyMap[PlayerControls.Left] }, () => { rotator.SetDestinationAngle(315f); } }, { new[] { keyMap[PlayerControls.Down], keyMap[PlayerControls.Right] }, () => { rotator.SetDestinationAngle(135f); } }, { new[] { keyMap[PlayerControls.Down], keyMap[PlayerControls.Left] }, () => { rotator.SetDestinationAngle(225f); } }, { new[] { keyMap[PlayerControls.Left] }, () => { rotator.SetDestinationAngle(270f); } }, { new[] { keyMap[PlayerControls.Right] }, () => { rotator.SetDestinationAngle(90f); } }, { new[] { keyMap[PlayerControls.Up] }, () => { rotator.SetDestinationAngle(0f); } }, { new[] { keyMap[PlayerControls.Down] }, () => { rotator.SetDestinationAngle(180f); } }, }, () => rotator.StopRotation()); }