private static char getDirectByAction (final char action) {
        final char direct;
        switch (action) {
            case ACTION_UP:
                direct = DIRECT_UP;
                break;
            case ACTION_DOWN:
                direct = DIRECT_DOWN;
                break;
            case ACTION_LEFT:
                direct = DIRECT_LEFT;
                break;
            case ACTION_RIGHT:
                direct = DIRECT_RIGHT;
                break;
            case ACTION_WAIT:
                direct = DIRECT_NONE;
                break;
            case ACTION_ABORT:
                direct = DIRECT_NONE;
                break;
            default:
                // Invalid action.
                direct = '\0';
        }
        return direct;
    }