import Game = Phaser.Game;
import GameObjectFactory = Phaser.GameObjectFactory;

import {MenuScreen} from 'states/MenuScreen';
import {ActOne} from 'states/ActOne';
import {Ritual} from "./states/Ritual";
import {ActTwo} from "./states/ActTwo";
import {GameOver} from "./states/GameOver";
import {End} from "./states/End";

class Main {
    game:Game;
    menu:MenuScreen;
    actOne:ActOne;
    actTwo:ActTwo;
    ritual:Ritual;
    gameOver:GameOver;
    end:End;

    constructor() {
        this.game = new Game(800, 600, Phaser.AUTO, $('.screen').get(0), {
            preload: this.preload,
            create: this.create,
            update: this.update
        });
    }

    preload = () => {
    };

    create = () => {
        this.menu = new MenuScreen();
        this.ritual = new Ritual();
        this.actOne = new ActOne();
        this.actTwo = new ActTwo();
        this.gameOver = new GameOver();
        this.end = new End();

        this.game.state.add('actOne', this.actOne, false);
        this.game.state.add('actTwo', this.actTwo, false);
        this.game.state.add('menu', this.menu, false);
        this.game.state.add('ritual', this.ritual, false);
        this.game.state.add('gameOver', this.gameOver, false);
        this.game.state.add('end', this.end, false);

        this.game.state.start('menu');
    };

    update = () => {
    };
}


$(()=> {
    var main = new Main();
});