public Joystick(Axis horizontal, Axis vertical) { mHorizontal = horizontal; mVertical = vertical; }
/* * Sets horizontal axis of the joystick. * * Returns: * Returns true if the axis was set. * * Preconditions: * 'horizontal' must not be null */ bool setHorizontalAxis(Axis horizontal) { if (horizontal == null) return false; mHorizontal = horizontal; return true; }
/* * Sets vertical axis of the joystick. * * Returns: * Returns true if the axis was set. * * Preconditions: * 'vertical' must not be null */ bool setVerticalAxis(Axis vertical) { if (vertical == null) return false; mVertical = vertical; return true; }