var Phaser = Phaser || {};
var Ritual = Ritual || {};

Ritual.BootState = function () {
    "use strict";
    Phaser.State.call(this);
};

Ritual.prototype = Object.create(Phaser.State.prototype);
Ritual.prototype.constructor = Ritual.BootState;

Ritual.BootState.prototype.init = function (level_name, level_file) {
    "use strict";
	//console.log('init ' + level_name + ' ' + level_file);
    this.level_name = level_name;
	this.level_file = level_file;
};

Ritual.BootState.prototype.preload = function () {
    "use strict";
	//console.log('preload');
    this.load.text(this.level_name, this.level_file);
};

Ritual.BootState.prototype.create = function () {
    "use strict";
	//console.log('create');
    var level_text, level_data;
    level_text = this.game.cache.getText(this.level_name);
    level_data = JSON.parse(level_text);
    this.game.state.start("LoadingState", true, false, level_data);
};