// gets/stores highscore in the local storage
const HIGH_SCORE_TAG = "@robotical-cog-shooter-game-high-score";
export const getHighScore = () => {
    const highScore = localStorage.getItem(HIGH_SCORE_TAG);
    if (!highScore) {
        return 0;
    }
    return parseInt(highScore);
};
export const setHighScore = (score) => {
    localStorage.setItem(HIGH_SCORE_TAG, score.toString());
};
export const updateHighScore = (score) => {
    const highScore = getHighScore();
    if (score > highScore) {
        setHighScore(score);
    }
};
