// Copyright (c) 2005-2010 David Caldwell <david@porkrind.org>
// Copyright (c) 2005-2010 Jim Radford <radford@blackbean.org>
function score_game(){}
score_game.prototype.init=function(title_name,score_div,highscore_div,highscoretabs_div){this.name=title_name;this.high_score=new highscore_interval_viewer(highscore_div,highscoretabs_div,this.name);this.stats=new stats(this.name);this.score=new Stat(score_div,"score",this.stats);}
var gotd;score_game.prototype.new_game=function(seed){this.seed=gotd?gotd.pick_seed(seed,this.name):Math.floor(Math.random()*0x7fffffff);srand(this.seed);this.game_id=(new Date()).getTime()+Math.random();this.stats.start();this.stats.set("seed",this.seed);this.stats.set("game_id",this.game_id);this.score.set(0);}
score_game.prototype.end_game=function(){this.stats.done(wrap(this,function(play_id,error){if(error)new_text_alert(error);else this.high_score.refresh(play_id);}));}
