export class Sequence {
    constructor(private game:Phaser.Game) {
    }

    chain = (time:number, action:()=>void):JQueryDeferred<any> => {
        var defer = $.Deferred();
        this.game.time.events.add(time, ()=> {
            if (action) {
                action();
            }
            defer.resolve(this);
        });
        return defer;
    };
}