private void SetDirection() { if (buttons[0].IsPressed && buttons[1].IsPressed) { direction.Set(45); } if (buttons[0].IsPressed && buttons[3].IsPressed) { direction.Set(315); } if (buttons[1].IsPressed && buttons[2].IsPressed) { direction.Set(135); } if (buttons[2].IsPressed && buttons[3].IsPressed) { direction.Set(225); } if (buttons[0].IsPressed) { direction.Set(360); } if (buttons[1].IsPressed) { direction.Set(90); } if (buttons[2].IsPressed) { direction.Set(180); } if (buttons[3].IsPressed) { direction.Set(270); } if (buttons.All(b => b.IsPressed == false)) { direction.Set(0); } }
public void Use(int dir, int per) { direction.Set(dir); trigger.Use(per); }