toJoyHatValue method
Get a joy hat value.
Implementation
JoyHatValue toJoyHatValue() {
switch (this) {
case SDL_HAT_LEFTUP:
return JoyHatValue.leftUp;
case SDL_HAT_UP:
return JoyHatValue.up;
case SDL_HAT_RIGHTUP:
return JoyHatValue.rightUp;
case SDL_HAT_LEFT:
return JoyHatValue.left;
case SDL_HAT_CENTERED:
return JoyHatValue.centered;
case SDL_HAT_RIGHT:
return JoyHatValue.right;
case SDL_HAT_LEFTDOWN:
return JoyHatValue.leftDown;
case SDL_HAT_DOWN:
return JoyHatValue.down;
case SDL_HAT_RIGHTDOWN:
return JoyHatValue.rightDown;
default:
throw SdlError(this, 'Invalid joy hat value.');
}
}