var __reflect = (this && this.__reflect) || function (p, c, t) {
    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;
};
var State = (function () {
    function State(name) {
        this._name = name;
        this._beginFun = [];
        this._endFun = [];
    }
    Object.defineProperty(State.prototype, "name", {
        get: function () {
            return this._name;
        },
        enumerable: true,
        configurable: true
    });
    State.prototype.pushFront = function (fun) {
        if (fun && this._beginFun.indexOf(fun) == -1) {
            this._beginFun.push(fun);
        }
    };
    State.prototype.pushBack = function (fun) {
        if (fun && this._endFun.indexOf(fun) == -1) {
            this._endFun.push(fun);
        }
    };
    State.prototype.start = function () {
        var i;
        var len = this._beginFun.length;
        for (i = 0; i < len; ++i) {
            this._beginFun[i].call(this);
        }
    };
    State.prototype.end = function () {
        var i;
        var len = this._endFun.length;
        for (i = 0; i < len; ++i) {
            this._endFun[i].call(this);
        }
    };
    return State;
}());
__reflect(State.prototype, "State");
//# sourceMappingURL=State.js.map