toJoystickDeviceState method

DeviceState toJoystickDeviceState()

Return a device state.

Implementation

DeviceState toJoystickDeviceState() {
  switch (this) {
    case SDL_EventType.SDL_JOYDEVICEADDED:
      return DeviceState.added;
    case SDL_EventType.SDL_JOYDEVICEREMOVED:
      return DeviceState.removed;
    default:
      throw SdlError(this, 'Invalid joystick device state.');
  }
}