/*
 * Javascript MineSweeper v0.2
 * http://labs.ugolandini.com/minesweeper
 *
 * Copyright (c) 2010 Ugo Landini
 * Dual licensed under the MIT and GPL licenses.
 * http://labs.ugolandini.com/license/GPL-LICENSE.txt
 * http://labs.ugolandini.com/license/MIT-LICENSE.txt
 *
 * Date:            2010-01-10
 * Last updated:    2010-01-10
 */

function Utilities() {
}

Utilities.alert = {

    buttons:{Replay:true, Restart:false},
    callback: function(v, m) {

        var mineField = $('#mineField').data("mineField");
        if (v) {
            mineField.replayGame();
        }
        else {
            mineField.clearGame();
        }
        mineField.appendToTable(mineField.table);

    }
};

Utilities.gameLost = function() {
    $.prompt('You lost the game in ' + MineTimer.passedTime() + ' seconds! You can Replay (same schema) or Restart (new Schema).', Utilities.alert);
};

Utilities.gameWon = function() {
    $.prompt('Great! You won the game in ' + MineTimer.passedTime() + ' seconds! You can Replay (same schema) or Restart (new Schema).', Utilities.alert);
};