toGameControllerBindType method

GameControllerBindType toGameControllerBindType()

Convert from a SDL_GameControllerBindType member.

Implementation

GameControllerBindType toGameControllerBindType() {
  switch (this) {
    case SDL_GameControllerBindType.SDL_CONTROLLER_BINDTYPE_NONE:
      return GameControllerBindType.none;
    case SDL_GameControllerBindType.SDL_CONTROLLER_BINDTYPE_BUTTON:
      return GameControllerBindType.button;
    case SDL_GameControllerBindType.SDL_CONTROLLER_BINDTYPE_AXIS:
      return GameControllerBindType.axis;
    case SDL_GameControllerBindType.SDL_CONTROLLER_BINDTYPE_HAT:
      return GameControllerBindType.hat;
    default:
      throw SdlError(
        this,
        'Unrecognised `SDL_GameControllerBindType` member.',
      );
  }
}