no more ids on levels, its generated automatically, and index utilization

This commit is contained in:
Peter Cottle 2013-01-09 12:49:40 -08:00
parent a1a6820d77
commit d406317788
10 changed files with 59 additions and 66 deletions

View file

@ -32,8 +32,11 @@ LevelArbiter.prototype.init = function() {
this.validateLevel(level);
this.levelMap[level.id] = _.extend(
{},
{ index: index },
level
level,
{
index: index,
id: levelSequenceName + String(index)
}
);
// build up the chaining between levels
@ -68,7 +71,6 @@ LevelArbiter.prototype.syncToStorage = function() {
LevelArbiter.prototype.validateLevel = function(level) {
level = level || {};
var requiredFields = [
'id',
'name',
'goalTreeString',
'solutionCommand'